Changes to encoding for Binary and unit test.
This commit is contained in:
Malcolm McRoberts 2017-09-25 00:02:10 -04:00
commit 511f4939c8
1455 changed files with 478339 additions and 191273 deletions

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<artifactId>hapi-fhir-standalone-overlay-example</artifactId>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-cli</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
@ -26,42 +26,42 @@
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-base</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-hl7org-dstu2</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu2.1</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-dstu3</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-structures-r4</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-dstu2</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir-validation-resources-dstu3</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<optional>true</optional>
</dependency>
</dependencies>

View File

@ -105,7 +105,7 @@ import org.hl7.fhir.dstu3.model.ResourceFactory;
import org.hl7.fhir.dstu3.utils.NarrativeGenerator;
import org.hl7.fhir.dstu3.utils.ToolingExtensions;
import org.hl7.fhir.exceptions.FHIRException;
import org.hl7.fhir.utilities.ucum.UcumService;
import org.fhir.ucum.UcumService;
import org.w3c.dom.Element;
/**
@ -260,7 +260,7 @@ public class CCDAConverter {
r.setText(new Narrative());
if (r.getText().getDiv() == null) {
r.getText().setStatus(NarrativeStatus.GENERATED);
// new NarrativeGenerator("", "", context).generate(r);
new NarrativeGenerator("", "", context).generate(r);
}
r.setMeta(new Meta().setLastUpdatedElement(InstantType.now()));
r.setId(id);

View File

@ -86,7 +86,7 @@ import org.hl7.fhir.dstu3.model.Type;
import org.hl7.fhir.utilities.CommaSeparatedStringBuilder;
import org.hl7.fhir.utilities.OIDUtils;
import org.hl7.fhir.utilities.Utilities;
import org.hl7.fhir.utilities.ucum.UcumService;
import org.fhir.ucum.UcumService;
import org.w3c.dom.Element;
import org.w3c.dom.Node;

View File

@ -20,7 +20,6 @@ package org.hl7.fhir.convertors;
* #L%
*/
import org.hl7.fhir.exceptions.FHIRException;
public interface VersionConvertorAdvisor30 {

View File

@ -20,7 +20,6 @@ package org.hl7.fhir.convertors;
* #L%
*/
import org.hl7.fhir.exceptions.FHIRException;
public interface VersionConvertorAdvisor40 {

View File

@ -20,7 +20,6 @@ package org.hl7.fhir.convertors;
* #L%
*/
import java.util.ArrayList;
import java.util.List;

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<artifactId>hapi-deployable-pom</artifactId>
<groupId>ca.uhn.hapi.fhir</groupId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -6,7 +6,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -0,0 +1,52 @@
package ca.uhn.fhir.jpa.subscription;
/*-
* #%L
* HAPI FHIR JPA Server
* %%
* Copyright (C) 2014 - 2017 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessageHeaders;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonAutoDetect(creatorVisibility = JsonAutoDetect.Visibility.NONE, fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
public abstract class BaseJsonMessage<T> implements Message<T> {
private static final long serialVersionUID = 1L;
@JsonProperty("headers")
private MessageHeaders myHeaders;
/**
* Constructor
*/
public BaseJsonMessage() {
super();
}
@Override
public MessageHeaders getHeaders() {
return myHeaders;
}
public void setHeaders(MessageHeaders theHeaders) {
myHeaders = theHeaders;
}
}

View File

@ -37,6 +37,7 @@ public abstract class BaseSubscriptionDeliverySubscriber extends BaseSubscriptio
@Override
public void handleMessage(Message<?> theMessage) throws MessagingException {
if (!(theMessage.getPayload() instanceof ResourceDeliveryMessage)) {
ourLog.warn("Unexpected payload type: {}", theMessage.getPayload());
return;
}
try {

View File

@ -50,7 +50,6 @@ import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.messaging.MessageHandler;
import org.springframework.messaging.SubscribableChannel;
import org.springframework.messaging.support.ExecutorSubscribableChannel;
import org.springframework.messaging.support.GenericMessage;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.transaction.support.TransactionSynchronizationAdapter;
import org.springframework.transaction.support.TransactionSynchronizationManager;
@ -346,6 +345,21 @@ public abstract class BaseSubscriptionInterceptor<S extends IBaseResource> exten
submitResourceModified(msg);
}
protected void sendToProcessingChannel(final ResourceModifiedMessage theMessage) {
ourLog.trace("Registering synchronization to send resource modified message to processing channel");
/*
* We only actually submit this item work working after the
*/
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
ourLog.trace("Sending resource modified message to processing channel");
getProcessingChannel().send(new ResourceModifiedJsonMessage(theMessage));
}
});
}
public void setFhirContext(FhirContext theCtx) {
myCtx = theCtx;
}
@ -442,24 +456,8 @@ public abstract class BaseSubscriptionInterceptor<S extends IBaseResource> exten
}
protected void submitResourceModified(final ResourceModifiedMessage theMsg) {
final GenericMessage<ResourceModifiedMessage> message = new GenericMessage<>(theMsg);
mySubscriptionActivatingSubscriber.handleMessage(theMsg.getOperationType(), theMsg.getId(myCtx), theMsg.getNewPayload(myCtx));
sendToProcessingChannel(message);
}
protected void sendToProcessingChannel(final GenericMessage<ResourceModifiedMessage> theMessage) {
ourLog.trace("Registering synchronization to send resource modified message to processing channel");
/*
* We only actually submit this item work working after the
*/
TransactionSynchronizationManager.registerSynchronization(new TransactionSynchronizationAdapter() {
@Override
public void afterCommit() {
ourLog.trace("Sending resource modified message to processing channel");
getProcessingChannel().send(theMessage);
}
});
sendToProcessingChannel(theMsg);
}
protected abstract void unregisterDeliverySubscriber();

View File

@ -0,0 +1,57 @@
package ca.uhn.fhir.jpa.subscription;
/*-
* #%L
* HAPI FHIR JPA Server
* %%
* Copyright (C) 2014 - 2017 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonAutoDetect(creatorVisibility = JsonAutoDetect.Visibility.NONE, fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
public class ResourceDeliveryJsonMessage extends BaseJsonMessage<ResourceDeliveryMessage> {
@JsonProperty("payload")
private ResourceDeliveryMessage myPayload;
/**
* Constructor
*/
public ResourceDeliveryJsonMessage() {
super();
}
/**
* Constructor
*/
public ResourceDeliveryJsonMessage(ResourceDeliveryMessage thePayload) {
myPayload = thePayload;
}
@Override
public ResourceDeliveryMessage getPayload() {
return myPayload;
}
public void setPayload(ResourceDeliveryMessage thePayload) {
myPayload = thePayload;
}
}

View File

@ -0,0 +1,57 @@
package ca.uhn.fhir.jpa.subscription;
/*-
* #%L
* HAPI FHIR JPA Server
* %%
* Copyright (C) 2014 - 2017 University Health Network
* %%
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
* #L%
*/
import com.fasterxml.jackson.annotation.JsonAutoDetect;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonProperty;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonAutoDetect(creatorVisibility = JsonAutoDetect.Visibility.NONE, fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
public class ResourceModifiedJsonMessage extends BaseJsonMessage<ResourceModifiedMessage> {
@JsonProperty("headers")
private ResourceModifiedMessage myPayload;
/**
* Constructor
*/
public ResourceModifiedJsonMessage() {
super();
}
/**
* Constructor
*/
public ResourceModifiedJsonMessage(ResourceModifiedMessage thePayload) {
myPayload = thePayload;
}
@Override
public ResourceModifiedMessage getPayload() {
return myPayload;
}
public void setPayload(ResourceModifiedMessage thePayload) {
myPayload = thePayload;
}
}

View File

@ -29,11 +29,9 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import java.io.Serializable;
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonAutoDetect(creatorVisibility = JsonAutoDetect.Visibility.NONE, fieldVisibility = JsonAutoDetect.Visibility.NONE, getterVisibility = JsonAutoDetect.Visibility.NONE, isGetterVisibility = JsonAutoDetect.Visibility.NONE, setterVisibility = JsonAutoDetect.Visibility.NONE)
public class ResourceModifiedMessage implements Serializable {
public class ResourceModifiedMessage {
private static final long serialVersionUID = 1L;

View File

@ -30,16 +30,12 @@ import ca.uhn.fhir.rest.api.server.RequestDetails;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.instance.model.api.IBaseResource;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.hl7.fhir.r4.model.Subscription;
import org.hl7.fhir.utilities.ucum.Canonical;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.messaging.Message;
import org.springframework.messaging.MessagingException;
import org.springframework.messaging.support.GenericMessage;
import java.util.Collection;
import java.util.List;
public class SubscriptionCheckingSubscriber extends BaseSubscriptionSubscriber {
@ -53,12 +49,12 @@ public class SubscriptionCheckingSubscriber extends BaseSubscriptionSubscriber {
public void handleMessage(Message<?> theMessage) throws MessagingException {
ourLog.trace("Handling resource modified message: {}", theMessage);
if (!(theMessage.getPayload() instanceof ResourceModifiedMessage)) {
ourLog.warn("Unexpected message payload type: {}", theMessage.getPayload());
if (!(theMessage instanceof ResourceModifiedJsonMessage)) {
ourLog.warn("Unexpected message payload type: {}", theMessage);
return;
}
ResourceModifiedMessage msg = (ResourceModifiedMessage) theMessage.getPayload();
ResourceModifiedMessage msg = ((ResourceModifiedJsonMessage) theMessage).getPayload();
switch (msg.getOperationType()) {
case CREATE:
case UPDATE:
@ -122,7 +118,8 @@ public class SubscriptionCheckingSubscriber extends BaseSubscriptionSubscriber {
deliveryMsg.setOperationType(msg.getOperationType());
deliveryMsg.setPayloadId(msg.getId(getContext()));
getSubscriptionInterceptor().getDeliveryChannel().send(new GenericMessage<>(deliveryMsg));
ResourceDeliveryJsonMessage wrappedMsg = new ResourceDeliveryJsonMessage(deliveryMsg);
getSubscriptionInterceptor().getDeliveryChannel().send(wrappedMsg);
}
}

View File

@ -0,0 +1,238 @@
package ca.uhn.fhir.jpa.config.min;
import ca.uhn.fhir.context.BaseRuntimeChildDefinition;
import ca.uhn.fhir.context.BaseRuntimeElementCompositeDefinition;
import ca.uhn.fhir.context.FhirContext;
import ca.uhn.fhir.model.api.IResource;
import ca.uhn.fhir.model.dstu2.resource.Bundle;
import ca.uhn.fhir.model.dstu2.resource.Bundle.Entry;
import ca.uhn.fhir.parser.IParser;
import ca.uhn.fhir.rest.api.EncodingEnum;
import ca.uhn.fhir.util.BundleUtil;
import ch.qos.logback.classic.LoggerContext;
import ch.qos.logback.core.joran.util.ConfigurationWatchListUtil;
import org.apache.commons.io.FileUtils;
import org.apache.commons.io.IOUtils;
import org.apache.commons.lang3.StringUtils;
import org.hl7.fhir.instance.model.api.IBaseBundle;
import org.hl7.fhir.instance.model.api.IBaseResource;
import java.io.*;
import java.net.URL;
import java.util.Collection;
public class ResourceMinimizerMojo {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(ResourceMinimizerMojo.class);
private String fhirVersion;
private long myByteCount;
private FhirContext myCtx;
private int myFileCount;
private File targetDirectory;
public void execute() throws Exception {
ourLog.info("Starting resource minimizer");
if (myCtx != null) {
// nothing
} else if ("DSTU2".equals(fhirVersion)) {
myCtx = FhirContext.forDstu2();
} else if ("HL7ORG_DSTU2".equals(fhirVersion)) {
myCtx = FhirContext.forDstu2Hl7Org();
} else if ("DSTU2_1".equals(fhirVersion)) {
myCtx = FhirContext.forDstu2_1();
} else if ("DSTU3".equals(fhirVersion)) {
myCtx = FhirContext.forDstu3();
} else if ("R4".equals(fhirVersion)) {
myCtx = FhirContext.forR4();
} else {
throw new Exception("Unknown version: " + fhirVersion);
}
ourLog.info("Looking for files in directory: {}", targetDirectory.getAbsolutePath());
Collection<File> files = FileUtils.listFiles(targetDirectory, new String[] { "xml", "json" }, true);
for (File nextFile : files) {
ourLog.debug("Checking file: {}", nextFile);
String inputString;
try {
inputString = IOUtils.toString(new FileInputStream(nextFile), "UTF-8");
} catch (IOException e) {
throw new Exception("Failed to read file: " + nextFile, e);
}
IParser parser = EncodingEnum.detectEncoding(inputString).newParser(myCtx);
IBaseResource input = parser.parseResource(inputString);
if (input instanceof IResource) {
((IResource) input).getText().getDiv().setValueAsString((String) null);
((IResource) input).getText().getStatus().setValueAsString((String) null);
if (input instanceof Bundle) {
for (Entry nextEntry : ((Bundle) input).getEntry()) {
if (nextEntry.getResource() != null) {
nextEntry.getResource().getText().getDiv().setValueAsString((String) null);
nextEntry.getResource().getText().getStatus().setValueAsString((String) null);
}
}
}
} else {
minimizeResource((IBaseResource)input);
}
String outputString = parser.setPrettyPrint(true).encodeResourceToString(input);
StringBuilder b = new StringBuilder();
for (String nextLine : outputString.split("\\n")) {
int i;
for (i = 0; i < nextLine.length(); i++) {
if (nextLine.charAt(i) != ' ') {
break;
}
}
b.append(StringUtils.leftPad("", i / 3, ' '));
b.append(nextLine.substring(i));
b.append("\n");
}
outputString = b.toString();
if (!inputString.equals(outputString)) {
ourLog.info("Trimming contents of resource: {} - From {} to {}", nextFile, FileUtils.byteCountToDisplaySize(inputString.length()), FileUtils.byteCountToDisplaySize(outputString.length()));
myByteCount += (inputString.length() - outputString.length());
myFileCount++;
try {
String f = nextFile.getAbsolutePath();
Writer w = new OutputStreamWriter(new FileOutputStream(f, false), "UTF-8");
w = new BufferedWriter(w);
w.append(outputString);
w.close();
} catch (IOException e) {
throw new Exception("Failed to write " + nextFile, e);
}
}
}
}
public long getByteCount() {
return myByteCount;
}
public int getFileCount() {
return myFileCount;
}
private void minimizeResource(IBaseResource theInput) {
if (theInput instanceof IBaseBundle) {
for (IBaseResource next : BundleUtil.toListOfResources(myCtx, (IBaseBundle) theInput)) {
minimizeResource(next);
}
}
BaseRuntimeElementCompositeDefinition<?> element = (BaseRuntimeElementCompositeDefinition) myCtx.getElementDefinition(theInput.getClass());
BaseRuntimeChildDefinition textElement = element.getChildByName("text");
if (textElement != null) {
textElement.getMutator().setValue(theInput, null);
}
}
public static void main(String[] args) throws Exception {
FhirContext ctxDstu2;
// FhirContext ctxDstu2_1;
FhirContext ctxDstu3;
FhirContext ctxR4;
ctxDstu2 = FhirContext.forDstu2();
// ctxDstu2_1 = FhirContext.forDstu2_1();
ctxDstu3 = FhirContext.forDstu3();
ctxR4 = FhirContext.forR4();
LoggerContext loggerContext = ((ch.qos.logback.classic.Logger) ourLog).getLoggerContext();
URL mainURL = ConfigurationWatchListUtil.getMainWatchURL(loggerContext);
System.out.println(mainURL);
// or even
ourLog.info("Logback used '{}' as the configuration file.", mainURL);
int fileCount = 0;
long byteCount = 0;
ResourceMinimizerMojo m = new ResourceMinimizerMojo();
m.myCtx = ctxDstu2;
m.targetDirectory = new File("./hapi-tinder-plugin/src/main/resources/vs/dstu2");
m.fhirVersion = "DSTU2";
m.execute();
byteCount += m.getByteCount();
fileCount += m.getFileCount();
m = new ResourceMinimizerMojo();
m.myCtx = ctxDstu2;
m.targetDirectory = new File("./hapi-fhir-validation-resources-dstu2/src/main/resources/org/hl7/fhir/instance/model/valueset");
m.fhirVersion = "DSTU2";
m.execute();
byteCount += m.getByteCount();
fileCount += m.getFileCount();
m = new ResourceMinimizerMojo();
m.myCtx = ctxDstu2;
m.targetDirectory = new File("./hapi-fhir-validation-resources-dstu2/src/main/resources/org/hl7/fhir/instance/model/profile");
m.fhirVersion = "DSTU2";
m.execute();
byteCount += m.getByteCount();
fileCount += m.getFileCount();
m = new ResourceMinimizerMojo();
m.myCtx = ctxDstu3;
m.targetDirectory = new File("./hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/profile");
m.fhirVersion = "DSTU3";
m.execute();
byteCount += m.getByteCount();
fileCount += m.getFileCount();
m = new ResourceMinimizerMojo();
m.myCtx = ctxDstu3;
m.targetDirectory = new File("./hapi-fhir-validation-resources-dstu3/src/main/resources/org/hl7/fhir/dstu3/model/valueset");
m.fhirVersion = "DSTU3";
m.execute();
byteCount += m.getByteCount();
// m = new ResourceMinimizerMojo();
// m.myCtx = ctxDstu2_1;
// m.targetDirectory = new File("./hapi-fhir-validation-resources-dstu2.1/src/main/resources/org/hl7/fhir/dstu2016may/model/profile");
// m.fhirVersion = "DSTU2_1";
// m.execute();
// byteCount += m.getByteCount();
// fileCount += m.getFileCount();
//
// m = new ResourceMinimizerMojo();
// m.myCtx = ctxDstu2_1;
// m.targetDirectory = new File("./hapi-fhir-validation-resources-dstu2.1/src/main/resources/org/hl7/fhir/dstu2016may/model/valueset");
// m.fhirVersion = "DSTU2_1";
// m.execute();
// byteCount += m.getByteCount();
// fileCount += m.getFileCount();
m = new ResourceMinimizerMojo();
m.myCtx = ctxR4;
m.targetDirectory = new File("./hapi-fhir-validation-resources-r4/src/main/resources/org/hl7/fhir/r4/model/profile");
m.fhirVersion = "R4";
m.execute();
byteCount += m.getByteCount();
fileCount += m.getFileCount();
m = new ResourceMinimizerMojo();
m.myCtx = ctxR4;
m.targetDirectory = new File("./hapi-fhir-validation-resources-r4/src/main/resources/org/hl7/fhir/r4/model/valueset");
m.fhirVersion = "R4";
m.execute();
byteCount += m.getByteCount();
fileCount += m.getFileCount();
ourLog.info("Trimmed {} files", fileCount);
ourLog.info("Trimmed {} bytes", FileUtils.byteCountToDisplaySize(byteCount));
}
}

View File

@ -18,8 +18,6 @@ import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Test;
import org.springframework.data.mapping.PreferredConstructor;
import org.springframework.orm.jpa.JpaSystemException;
import java.util.Collections;
import java.util.List;
@ -38,7 +36,171 @@ public class FhirResourceDaoDstu3UniqueSearchParamTest extends BaseJpaDstu3Test
myDaoConfig.setDefaultSearchParamsCanBeOverridden(new DaoConfig().isDefaultSearchParamsCanBeOverridden());
}
@Before
public void before() {
myDaoConfig.setDefaultSearchParamsCanBeOverridden(true);
}
private void createUniqueBirthdateAndGenderSps() {
SearchParameter sp = new SearchParameter();
sp.setId("SearchParameter/patient-gender");
sp.setType(Enumerations.SearchParamType.TOKEN);
sp.setCode("gender");
sp.setExpression("Patient.gender");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-birthdate");
sp.setType(Enumerations.SearchParamType.DATE);
sp.setCode("birthdate");
sp.setExpression("Patient.birthDate");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-gender-birthdate");
sp.setType(Enumerations.SearchParamType.COMPOSITE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-gender"));
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-birthdate"));
sp.addExtension()
.setUrl(JpaConstants.EXT_SP_UNIQUE)
.setValue(new BooleanType(true));
mySearchParameterDao.update(sp);
mySearchParamRegsitry.forceRefresh();
}
private void createUniqueIndexCoverageBeneficiary() {
SearchParameter sp = new SearchParameter();
sp.setId("SearchParameter/coverage-beneficiary");
sp.setCode("beneficiary");
sp.setExpression("Coverage.beneficiary");
sp.setType(Enumerations.SearchParamType.REFERENCE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Coverage");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/coverage-identifier");
sp.setCode("identifier");
sp.setExpression("Coverage.identifier");
sp.setType(Enumerations.SearchParamType.TOKEN);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Coverage");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/coverage-beneficiary-identifier");
sp.setCode("coverage-beneficiary-identifier");
sp.setExpression("Coverage.beneficiary");
sp.setType(Enumerations.SearchParamType.COMPOSITE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Coverage");
sp.addComponent()
.setExpression("Coverage")
.setDefinition(new Reference("/SearchParameter/coverage-beneficiary"));
sp.addComponent()
.setExpression("Coverage")
.setDefinition(new Reference("/SearchParameter/coverage-identifier"));
sp.addExtension()
.setUrl(JpaConstants.EXT_SP_UNIQUE)
.setValue(new BooleanType(true));
mySearchParameterDao.update(sp);
mySearchParamRegsitry.forceRefresh();
}
private void createUniqueNameAndManagingOrganizationSps() {
SearchParameter sp = new SearchParameter();
sp.setId("SearchParameter/patient-name");
sp.setType(Enumerations.SearchParamType.STRING);
sp.setCode("name");
sp.setExpression("Patient.name");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-organization");
sp.setType(Enumerations.SearchParamType.REFERENCE);
sp.setCode("organization");
sp.setExpression("Patient.managingOrganization");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-name-organization");
sp.setType(Enumerations.SearchParamType.COMPOSITE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-name"));
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-organization"));
sp.addExtension()
.setUrl(JpaConstants.EXT_SP_UNIQUE)
.setValue(new BooleanType(true));
mySearchParameterDao.update(sp);
mySearchParamRegsitry.forceRefresh();
}
@Test
public void testDetectUniqueSearchParams() {
createUniqueBirthdateAndGenderSps();
List<JpaRuntimeSearchParam> params = mySearchParamRegsitry.getActiveUniqueSearchParams("Patient");
assertEquals(1, params.size());
assertEquals(params.get(0).isUnique(), true);
assertEquals(2, params.get(0).getCompositeOf().size());
// Should be alphabetical order
assertEquals("birthdate", params.get(0).getCompositeOf().get(0).getName());
assertEquals("gender", params.get(0).getCompositeOf().get(1).getName());
}
@Test
public void testDuplicateUniqueValuesAreRejected() {
createUniqueBirthdateAndGenderSps();
Patient pt1 = new Patient();
pt1.setGender(Enumerations.AdministrativeGender.MALE);
pt1.setBirthDateElement(new DateType("2011-01-01"));
IIdType id1 = myPatientDao.create(pt1).getId().toUnqualifiedVersionless();
try {
myPatientDao.create(pt1).getId().toUnqualifiedVersionless();
fail();
} catch (PreconditionFailedException e) {
// good
}
Patient pt2 = new Patient();
pt2.setGender(Enumerations.AdministrativeGender.MALE);
IIdType id2 = myPatientDao.create(pt2).getId().toUnqualifiedVersionless();
pt2 = new Patient();
pt2.setId(id2);
pt2.setGender(Enumerations.AdministrativeGender.MALE);
pt2.setBirthDateElement(new DateType("2011-01-01"));
try {
myPatientDao.update(pt2);
fail();
} catch (PreconditionFailedException e) {
// good
}
}
@Test
public void testIndexTransactionWithMatchUrl() {
@ -65,7 +227,6 @@ public class FhirResourceDaoDstu3UniqueSearchParamTest extends BaseJpaDstu3Test
}
@Test
public void testIndexTransactionWithMatchUrl2() {
createUniqueIndexCoverageBeneficiary();
@ -176,190 +337,6 @@ public class FhirResourceDaoDstu3UniqueSearchParamTest extends BaseJpaDstu3Test
}
private void createUniqueIndexCoverageBeneficiary() {
SearchParameter sp = new SearchParameter();
sp.setId("SearchParameter/coverage-beneficiary");
sp.setCode("beneficiary");
sp.setExpression("Coverage.beneficiary");
sp.setType(Enumerations.SearchParamType.REFERENCE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Coverage");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/coverage-identifier");
sp.setCode("identifier");
sp.setExpression("Coverage.identifier");
sp.setType(Enumerations.SearchParamType.TOKEN);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Coverage");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/coverage-beneficiary-identifier");
sp.setCode("coverage-beneficiary-identifier");
sp.setExpression("Coverage.beneficiary");
sp.setType(Enumerations.SearchParamType.COMPOSITE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Coverage");
sp.addComponent()
.setExpression("Coverage")
.setDefinition(new Reference("/SearchParameter/coverage-beneficiary"));
sp.addComponent()
.setExpression("Coverage")
.setDefinition(new Reference("/SearchParameter/coverage-identifier"));
sp.addExtension()
.setUrl(JpaConstants.EXT_SP_UNIQUE)
.setValue(new BooleanType(true));
mySearchParameterDao.update(sp);
mySearchParamRegsitry.forceRefresh();
}
@Before
public void before() {
myDaoConfig.setDefaultSearchParamsCanBeOverridden(true);
}
private void createUniqueBirthdateAndGenderSps() {
SearchParameter sp = new SearchParameter();
sp.setId("SearchParameter/patient-gender");
sp.setType(Enumerations.SearchParamType.TOKEN);
sp.setCode("gender");
sp.setExpression("Patient.gender");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-birthdate");
sp.setType(Enumerations.SearchParamType.DATE);
sp.setCode("birthdate");
sp.setExpression("Patient.birthDate");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-gender-birthdate");
sp.setType(Enumerations.SearchParamType.COMPOSITE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-gender"));
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-birthdate"));
sp.addExtension()
.setUrl(JpaConstants.EXT_SP_UNIQUE)
.setValue(new BooleanType(true));
mySearchParameterDao.update(sp);
mySearchParamRegsitry.forceRefresh();
}
private void createUniqueNameAndManagingOrganizationSps() {
SearchParameter sp = new SearchParameter();
sp.setId("SearchParameter/patient-name");
sp.setType(Enumerations.SearchParamType.STRING);
sp.setCode("name");
sp.setExpression("Patient.name");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-organization");
sp.setType(Enumerations.SearchParamType.REFERENCE);
sp.setCode("organization");
sp.setExpression("Patient.managingOrganization");
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
mySearchParameterDao.update(sp);
sp = new SearchParameter();
sp.setId("SearchParameter/patient-name-organization");
sp.setType(Enumerations.SearchParamType.COMPOSITE);
sp.setStatus(PublicationStatus.ACTIVE);
sp.addBase("Patient");
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-name"));
sp.addComponent()
.setExpression("Patient")
.setDefinition(new Reference("SearchParameter/patient-organization"));
sp.addExtension()
.setUrl(JpaConstants.EXT_SP_UNIQUE)
.setValue(new BooleanType(true));
mySearchParameterDao.update(sp);
mySearchParamRegsitry.forceRefresh();
}
@Test
public void testDetectUniqueSearchParams() {
createUniqueBirthdateAndGenderSps();
List<JpaRuntimeSearchParam> params = mySearchParamRegsitry.getActiveUniqueSearchParams("Patient");
assertEquals(1, params.size());
assertEquals(params.get(0).isUnique(), true);
assertEquals(2, params.get(0).getCompositeOf().size());
// Should be alphabetical order
assertEquals("birthdate", params.get(0).getCompositeOf().get(0).getName());
assertEquals("gender", params.get(0).getCompositeOf().get(1).getName());
}
@Test
public void testDuplicateUniqueValuesAreRejected() {
createUniqueBirthdateAndGenderSps();
Patient pt1 = new Patient();
pt1.setGender(Enumerations.AdministrativeGender.MALE);
pt1.setBirthDateElement(new DateType("2011-01-01"));
IIdType id1 = myPatientDao.create(pt1).getId().toUnqualifiedVersionless();
try {
myPatientDao.create(pt1).getId().toUnqualifiedVersionless();
fail();
} catch (PreconditionFailedException e) {
// good
}
Patient pt2 = new Patient();
pt2.setGender(Enumerations.AdministrativeGender.MALE);
IIdType id2 = myPatientDao.create(pt2).getId().toUnqualifiedVersionless();
pt2 = new Patient();
pt2.setId(id2);
pt2.setGender(Enumerations.AdministrativeGender.MALE);
pt2.setBirthDateElement(new DateType("2011-01-01"));
try {
myPatientDao.update(pt2);
fail();
} catch (PreconditionFailedException e) {
// good
}
}
@Test
public void testUniqueValuesAreIndexed_DateAndToken() {
createUniqueBirthdateAndGenderSps();
Patient pt1 = new Patient();
pt1.setGender(Enumerations.AdministrativeGender.MALE);
pt1.setBirthDateElement(new DateType("2011-01-01"));
IIdType id1 = myPatientDao.create(pt1).getId().toUnqualifiedVersionless();
List<ResourceIndexedCompositeStringUnique> uniques = myResourceIndexedCompositeStringUniqueDao.findAll();
assertEquals(1, uniques.size());
assertEquals("Patient/" + id1.getIdPart(), uniques.get(0).getResource().getIdDt().toUnqualifiedVersionless().getValue());
assertEquals("Patient?birthdate=2011-01-01&gender=http%3A%2F%2Fhl7.org%2Ffhir%2Fadministrative-gender%7Cmale", uniques.get(0).getIndexString());
}
@Test
public void testSearchSynchronousUsingUniqueComposite() {
createUniqueBirthdateAndGenderSps();
@ -384,7 +361,7 @@ public class FhirResourceDaoDstu3UniqueSearchParamTest extends BaseJpaDstu3Test
assertEquals(SearchBuilder.HandlerTypeEnum.UNIQUE_INDEX, SearchBuilder.getLastHandlerMechanismForUnitTest());
}
@Test
@Test
public void testSearchUsingUniqueComposite() {
createUniqueBirthdateAndGenderSps();
@ -392,6 +369,7 @@ public class FhirResourceDaoDstu3UniqueSearchParamTest extends BaseJpaDstu3Test
pt1.setGender(Enumerations.AdministrativeGender.MALE);
pt1.setBirthDateElement(new DateType("2011-01-01"));
IIdType id1 = myPatientDao.create(pt1).getId().toUnqualifiedVersionless();
assertNotNull(id1);
Patient pt2 = new Patient();
pt2.setGender(Enumerations.AdministrativeGender.MALE);
@ -414,7 +392,9 @@ public class FhirResourceDaoDstu3UniqueSearchParamTest extends BaseJpaDstu3Test
params.add("gender", new TokenParam("http://hl7.org/fhir/administrative-gender", "male"));
results = myPatientDao.search(params);
assertEquals(searchId, results.getUuid());
assertThat(toUnqualifiedVersionlessIdValues(results), containsInAnyOrder(id1.getValue()));
String id1Value = id1.getValue();
List<String> actualValues = toUnqualifiedVersionlessIdValues(results);
assertThat(actualValues, containsInAnyOrder(id1Value));
// Null because we just reuse the last search
assertEquals(null, SearchBuilder.getLastHandlerMechanismForUnitTest());
@ -435,6 +415,21 @@ public class FhirResourceDaoDstu3UniqueSearchParamTest extends BaseJpaDstu3Test
}
@Test
public void testUniqueValuesAreIndexed_DateAndToken() {
createUniqueBirthdateAndGenderSps();
Patient pt1 = new Patient();
pt1.setGender(Enumerations.AdministrativeGender.MALE);
pt1.setBirthDateElement(new DateType("2011-01-01"));
IIdType id1 = myPatientDao.create(pt1).getId().toUnqualifiedVersionless();
List<ResourceIndexedCompositeStringUnique> uniques = myResourceIndexedCompositeStringUniqueDao.findAll();
assertEquals(1, uniques.size());
assertEquals("Patient/" + id1.getIdPart(), uniques.get(0).getResource().getIdDt().toUnqualifiedVersionless().getValue());
assertEquals("Patient?birthdate=2011-01-01&gender=http%3A%2F%2Fhl7.org%2Ffhir%2Fadministrative-gender%7Cmale", uniques.get(0).getIndexString());
}
@Test
public void testUniqueValuesAreIndexed_StringAndReference() {
createUniqueNameAndManagingOrganizationSps();

View File

@ -1,59 +1,136 @@
package ca.uhn.fhir.jpa.dao.dstu3;
import static org.hamcrest.Matchers.containsString;
import static org.hamcrest.Matchers.not;
import static org.hamcrest.Matchers.stringContainsInOrder;
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue;
import java.io.IOException;
import org.hl7.fhir.dstu3.model.CodeSystem;
import org.hl7.fhir.dstu3.model.CodeType;
import org.hl7.fhir.dstu3.model.CodeableConcept;
import org.hl7.fhir.dstu3.model.Coding;
import org.hl7.fhir.dstu3.model.IdType;
import org.hl7.fhir.dstu3.model.Parameters;
import org.hl7.fhir.dstu3.model.StringType;
import org.hl7.fhir.dstu3.model.UriType;
import org.hl7.fhir.dstu3.model.ValueSet;
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult;
import ca.uhn.fhir.rest.server.exceptions.ResourceNotFoundException;
import ca.uhn.fhir.util.TestUtil;
import org.hl7.fhir.dstu3.hapi.ctx.IValidationSupport;
import org.hl7.fhir.dstu3.model.*;
import org.hl7.fhir.instance.model.api.IIdType;
import org.hl7.fhir.instance.model.api.IPrimitiveType;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.Ignore;
import org.junit.Test;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import ca.uhn.fhir.jpa.dao.IFhirResourceDaoValueSet.ValidateCodeResult;
import ca.uhn.fhir.util.TestUtil;
import java.io.IOException;
import static junit.framework.Assert.assertNotNull;
import static org.hamcrest.Matchers.*;
import static org.junit.Assert.*;
public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDaoDstu3ValueSetTest.class);
private IIdType myExtensionalVsId;
@AfterClass
public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest();
}
@Autowired
private IValidationSupport myValidationSupport;
@Before
@Transactional
public void before02() throws IOException {
ValueSet upload = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml");
myExtensionalVsId = myValueSetDao.create(upload, mySrd).getId().toUnqualifiedVersionless();
CodeSystem upload2 = loadResourceFromClasspath(CodeSystem.class, "/extensional-case-3-cs.xml");
myCodeSystemDao.create(upload2, mySrd).getId().toUnqualifiedVersionless();
}
@Test
@Ignore
public void testBuiltInValueSetFetchAndExpand() {
try {
myValueSetDao.read(new IdType("ValueSet/endpoint-payload-type"));
fail();
} catch (ResourceNotFoundException e) {
// good
}
ValueSet vs = myValidationSupport.fetchResource(myFhirCtx, ValueSet.class, "http://hl7.org/fhir/ValueSet/endpoint-payload-type");
myValueSetDao.update(vs);
vs = myValueSetDao.read(new IdType("ValueSet/endpoint-payload-type"));
assertNotNull(vs);
assertEquals("http://hl7.org/fhir/ValueSet/endpoint-payload-type", vs.getUrl());
ValueSet expansion = myValueSetDao.expand(vs.getIdElement(), null, mySrd);
ourLog.info(myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expansion));
}
@Test
public void testExpandById() throws IOException {
String resp;
ValueSet expanded = myValueSetDao.expand(myExtensionalVsId, null, mySrd);
resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString("<ValueSet xmlns=\"http://hl7.org/fhir\">"));
assertThat(resp, containsString("<expansion>"));
assertThat(resp, containsString("<contains>"));
assertThat(resp, containsString("<system value=\"http://acme.org\"/>"));
assertThat(resp, containsString("<code value=\"8450-9\"/>"));
assertThat(resp, containsString("<display value=\"Systolic blood pressure--expiration\"/>"));
assertThat(resp, containsString("</contains>"));
assertThat(resp, containsString("<contains>"));
assertThat(resp, containsString("<system value=\"http://acme.org\"/>"));
assertThat(resp, containsString("<code value=\"11378-7\"/>"));
assertThat(resp, containsString("<display value=\"Systolic blood pressure at First encounter\"/>"));
assertThat(resp, containsString("</contains>"));
assertThat(resp, containsString("</expansion>"));
/*
* Filter with display name
*/
expanded = myValueSetDao.expand(myExtensionalVsId, ("systolic"), mySrd);
resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
//@formatter:off
assertThat(resp, stringContainsInOrder(
"<code value=\"11378-7\"/>",
"<display value=\"Systolic blood pressure at First encounter\"/>"));
//@formatter:on
}
@Test
@Ignore
public void testExpandByIdentifier() {
ValueSet expanded = myValueSetDao.expandByIdentifier("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", "11378");
String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
//@formatter:off
assertThat(resp, stringContainsInOrder(
"<code value=\"11378-7\"/>",
"<display value=\"Systolic blood pressure at First encounter\"/>"));
//@formatter:on
assertThat(resp, not(containsString("<code value=\"8450-9\"/>")));
}
/**
* This type of expansion doesn't really make sense..
*/
@Test
@Ignore
public void testExpandByValueSet() throws IOException {
ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml");
ValueSet expanded = myValueSetDao.expand(toExpand, "11378");
String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
//@formatter:off
assertThat(resp, stringContainsInOrder(
"<code value=\"11378-7\"/>",
"<display value=\"Systolic blood pressure at First encounter\"/>"));
//@formatter:on
assertThat(resp, not(containsString("<code value=\"8450-9\"/>")));
}
@Test
public void testValidateCodeOperationByCodeAndSystemBad() {
UriType valueSetIdentifier = null;
@ -123,6 +200,20 @@ public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
assertEquals("Systolic blood pressure at First encounter", result.getDisplay());
}
@Test
public void testValidateCodeOperationByResourceIdAndCodeAndSystem() {
UriType valueSetIdentifier = null;
IIdType id = myExtensionalVsId;
CodeType code = new CodeType("11378-7");
UriType system = new UriType("http://acme.org");
StringType display = null;
Coding coding = null;
CodeableConcept codeableConcept = null;
ValidateCodeResult result = myValueSetDao.validateCode(valueSetIdentifier, id, code, system, display, coding, codeableConcept, mySrd);
assertTrue(result.isResult());
assertEquals("Systolic blood pressure at First encounter", result.getDisplay());
}
@Test
public void testValidateCodeOperationByResourceIdAndCodeableConcept() {
UriType valueSetIdentifier = null;
@ -138,91 +229,6 @@ public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
assertEquals("Systolic blood pressure at First encounter", result.getDisplay());
}
@Test
public void testValidateCodeOperationByResourceIdAndCodeAndSystem() {
UriType valueSetIdentifier = null;
IIdType id = myExtensionalVsId;
CodeType code = new CodeType("11378-7");
UriType system = new UriType("http://acme.org");
StringType display = null;
Coding coding = null;
CodeableConcept codeableConcept = null;
ValidateCodeResult result = myValueSetDao.validateCode(valueSetIdentifier, id, code, system, display, coding, codeableConcept, mySrd);
assertTrue(result.isResult());
assertEquals("Systolic blood pressure at First encounter", result.getDisplay());
}
@Test
public void testExpandById() throws IOException {
String resp;
ValueSet expanded = myValueSetDao.expand(myExtensionalVsId, null, mySrd);
resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
assertThat(resp, containsString("<ValueSet xmlns=\"http://hl7.org/fhir\">"));
assertThat(resp, containsString("<expansion>"));
assertThat(resp, containsString("<contains>"));
assertThat(resp, containsString("<system value=\"http://acme.org\"/>"));
assertThat(resp, containsString("<code value=\"8450-9\"/>"));
assertThat(resp, containsString("<display value=\"Systolic blood pressure--expiration\"/>"));
assertThat(resp, containsString("</contains>"));
assertThat(resp, containsString("<contains>"));
assertThat(resp, containsString("<system value=\"http://acme.org\"/>"));
assertThat(resp, containsString("<code value=\"11378-7\"/>"));
assertThat(resp, containsString("<display value=\"Systolic blood pressure at First encounter\"/>"));
assertThat(resp, containsString("</contains>"));
assertThat(resp, containsString("</expansion>"));
/*
* Filter with display name
*/
expanded = myValueSetDao.expand(myExtensionalVsId, ("systolic"), mySrd);
resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
//@formatter:off
assertThat(resp, stringContainsInOrder(
"<code value=\"11378-7\"/>",
"<display value=\"Systolic blood pressure at First encounter\"/>"));
//@formatter:on
}
@Test
@Ignore
public void testExpandByIdentifier() {
ValueSet expanded = myValueSetDao.expandByIdentifier("http://www.healthintersections.com.au/fhir/ValueSet/extensional-case-2", "11378");
String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
//@formatter:off
assertThat(resp, stringContainsInOrder(
"<code value=\"11378-7\"/>",
"<display value=\"Systolic blood pressure at First encounter\"/>"));
//@formatter:on
assertThat(resp, not(containsString("<code value=\"8450-9\"/>")));
}
/**
* This type of expansion doesn't really make sense..
*/
@Test
@Ignore
public void testExpandByValueSet() throws IOException {
ValueSet toExpand = loadResourceFromClasspath(ValueSet.class, "/extensional-case-3-vs.xml");
ValueSet expanded = myValueSetDao.expand(toExpand, "11378");
String resp = myFhirCtx.newXmlParser().setPrettyPrint(true).encodeResourceToString(expanded);
ourLog.info(resp);
//@formatter:off
assertThat(resp, stringContainsInOrder(
"<code value=\"11378-7\"/>",
"<display value=\"Systolic blood pressure at First encounter\"/>"));
//@formatter:on
assertThat(resp, not(containsString("<code value=\"8450-9\"/>")));
}
@Test
public void testValiedateCodeAgainstBuiltInValueSetAndCodeSystemWithValidCode() {
IPrimitiveType<String> display = null;
@ -232,11 +238,16 @@ public class FhirResourceDaoDstu3ValueSetTest extends BaseJpaDstu3Test {
StringType code = new StringType("BRN");
StringType system = new StringType("http://hl7.org/fhir/v2/0487");
ValidateCodeResult result = myValueSetDao.validateCode(vsIdentifier, null, code, system, display, coding, codeableConcept, mySrd);
ourLog.info(result.getMessage());
assertTrue(result.getMessage(), result.isResult());
}
@AfterClass
public static void afterClassClearContext() {
TestUtil.clearAllStaticFieldsForUnitTest();
}
}

View File

@ -161,12 +161,12 @@ public class FhirResourceDaoR4SearchMissingTest extends BaseJpaR4Test {
@Test
public void testSearchWithMissingDate2() {
MedicationRequest mr1 = new MedicationRequest();
mr1.getCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
mr1.addCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
mr1.addDosageInstruction().getTiming().addEventElement().setValueAsString("2017-01-01");
IIdType id1 = myMedicationRequestDao.create(mr1).getId().toUnqualifiedVersionless();
MedicationRequest mr2 = new MedicationRequest();
mr2.getCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
mr2.addCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
IIdType id2 = myMedicationRequestDao.create(mr2).getId().toUnqualifiedVersionless();
SearchParameterMap map = new SearchParameterMap();

View File

@ -165,41 +165,6 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
return ids;
}
@Test
public void testUpdateThatCreatesReturnsHttp201() throws IOException {
Patient p = new Patient();
p.setId("A");
p.setActive(true);
String encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
HttpPut put = new HttpPut(ourServerBase + "/Patient/A");
put.setEntity(new StringEntity(encoded, "application/fhir+json", "UTF-8"));
CloseableHttpResponse response = ourHttpClient.execute(put);
try {
assertEquals(201, response.getStatusLine().getStatusCode());
} finally {
IOUtils.closeQuietly(response);
}
p = new Patient();
p.setId("A");
p.setActive(false);
encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
put = new HttpPut(ourServerBase + "/Patient/A");
put.setEntity(new StringEntity(encoded, "application/fhir+json", "UTF-8"));
response = ourHttpClient.execute(put);
try {
assertEquals(200, response.getStatusLine().getStatusCode());
} finally {
IOUtils.closeQuietly(response);
}
}
// Y
@Test
public void testBundleCreate() throws Exception {
@ -248,7 +213,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
//@formatter:off
assertThat(toUnqualifiedVersionlessIds(resp), contains(id));
//@formatter:off
resp = ourClient
.search()
@ -490,8 +455,6 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
@Test
public void testCreateResourceConditionalComplex() throws IOException {
Patient pt = new Patient();
@ -554,7 +517,6 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
response.close();
}
}
@Test
public void testCreateResourceWithNumericId() throws IOException {
@ -577,7 +539,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
response.close();
}
}
@Test
public void testCreateWithForcedId() throws IOException {
String methodName = "testCreateWithForcedId";
@ -893,7 +855,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
int initialSize = client.search().forResource(DocumentManifest.class).returnBundle(Bundle.class).execute().getEntry().size();
String resBody = IOUtils.toString(ResourceProviderR4Test.class.getResource("/documentmanifest.json"), StandardCharsets.UTF_8);
String resBody = IOUtils.toString(ResourceProviderR4Test.class.getResource("/r4/documentmanifest.json"), StandardCharsets.UTF_8);
client.create().resource(resBody).execute();
int newSize = client.search().forResource(DocumentManifest.class).returnBundle(Bundle.class).execute().getEntry().size();
@ -911,7 +873,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
int initialSize = client.search().forResource(DocumentReference.class).returnBundle(Bundle.class).execute().getEntry().size();
String resBody = IOUtils.toString(ResourceProviderR4Test.class.getResource("/documentreference.json"), StandardCharsets.UTF_8);
String resBody = IOUtils.toString(ResourceProviderR4Test.class.getResource("/r4/documentreference.json"), StandardCharsets.UTF_8);
client.create().resource(resBody).execute();
int newSize = client.search().forResource(DocumentReference.class).returnBundle(Bundle.class).execute().getEntry().size();
@ -1461,7 +1423,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
Collections.sort(ids);
ourLog.info("{} ids: {}", ids.size(), ids);
assertThat(responseBundle.getEntry().size(), lessThanOrEqualTo(25));
TreeSet<String> idsSet = new TreeSet<String>();
@ -1567,31 +1529,6 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
assertEquals(1, response.getEntry().size());
}
// private void delete(String theResourceType, String theParamName, String theParamValue) {
// Bundle resources;
// do {
// IQuery<Bundle> forResource = ourClient.search().forResource(theResourceType);
// if (theParamName != null) {
// forResource = forResource.where(new StringClientParam(theParamName).matches().value(theParamValue));
// }
// resources = forResource.execute();
// for (IResource next : resources.toListOfResources()) {
// ourLog.info("Deleting resource: {}", next.getId());
// ourClient.delete().resource(next).execute();
// }
// } while (resources.size() > 0);
// }
//
// private void deleteToken(String theResourceType, String theParamName, String theParamSystem, String theParamValue)
// {
// Bundle resources = ourClient.search().forResource(theResourceType).where(new
// TokenClientParam(theParamName).exactly().systemAndCode(theParamSystem, theParamValue)).execute();
// for (IResource next : resources.toListOfResources()) {
// ourLog.info("Deleting resource: {}", next.getId());
// ourClient.delete().resource(next).execute();
// }
// }
@SuppressWarnings("unused")
@Test
public void testFullTextSearch() throws RuntimeException, Exception {
@ -1620,6 +1557,31 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
}
// private void delete(String theResourceType, String theParamName, String theParamValue) {
// Bundle resources;
// do {
// IQuery<Bundle> forResource = ourClient.search().forResource(theResourceType);
// if (theParamName != null) {
// forResource = forResource.where(new StringClientParam(theParamName).matches().value(theParamValue));
// }
// resources = forResource.execute();
// for (IResource next : resources.toListOfResources()) {
// ourLog.info("Deleting resource: {}", next.getId());
// ourClient.delete().resource(next).execute();
// }
// } while (resources.size() > 0);
// }
//
// private void deleteToken(String theResourceType, String theParamName, String theParamSystem, String theParamValue)
// {
// Bundle resources = ourClient.search().forResource(theResourceType).where(new
// TokenClientParam(theParamName).exactly().systemAndCode(theParamSystem, theParamValue)).execute();
// for (IResource next : resources.toListOfResources()) {
// ourLog.info("Deleting resource: {}", next.getId());
// ourClient.delete().resource(next).execute();
// }
// }
@Test
public void testGetResourceCountsOperation() throws Exception {
String methodName = "testMetaOperations";
@ -1640,8 +1602,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
response.close();
}
}
@Test
public void testHasParameter() throws Exception {
IIdType pid0;
@ -1678,7 +1639,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
List<String> ids = searchAndReturnUnqualifiedVersionlessIdValues(uri);
assertThat(ids, contains(pid0.getValue()));
}
@Test
public void testHasParameterNoResults() throws Exception {
@ -1888,6 +1849,73 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
assertEquals(1, b.getEntry().size());
}
@Test
public void testMetaOperationWithNoMetaParameter() throws Exception {
Patient p = new Patient();
p.addName().setFamily("testMetaAddInvalid");
IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless();
//@formatter:off
String input = "<Parameters>\n" +
" <meta>\n" +
" <tag>\n" +
" <system value=\"http://example.org/codes/tags\"/>\n" +
" <code value=\"record-lost\"/>\n" +
" <display value=\"Patient File Lost\"/>\n" +
" </tag>\n" +
" </meta>\n" +
"</Parameters>";
//@formatter:on
HttpPost post = new HttpPost(ourServerBase + "/Patient/" + id.getIdPart() + "/$meta-add");
post.setEntity(new StringEntity(input, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
CloseableHttpResponse response = ourHttpClient.execute(post);
try {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(output);
assertEquals(400, response.getStatusLine().getStatusCode());
assertThat(output, containsString("Input contains no parameter with name 'meta'"));
} finally {
response.close();
}
post = new HttpPost(ourServerBase + "/Patient/" + id.getIdPart() + "/$meta-delete");
post.setEntity(new StringEntity(input, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
response = ourHttpClient.execute(post);
try {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(output);
assertEquals(400, response.getStatusLine().getStatusCode());
assertThat(output, containsString("Input contains no parameter with name 'meta'"));
} finally {
response.close();
}
}
@Test
public void testMetaOperations() throws Exception {
String methodName = "testMetaOperations";
Patient pt = new Patient();
pt.addName().setFamily(methodName);
IIdType id = ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless();
Meta meta = ourClient.meta().get(Meta.class).fromResource(id).execute();
assertEquals(0, meta.getTag().size());
Meta inMeta = new Meta();
inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
meta = ourClient.meta().add().onResource(id).meta(inMeta).execute();
assertEquals(1, meta.getTag().size());
inMeta = new Meta();
inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
meta = ourClient.meta().delete().onResource(id).meta(inMeta).execute();
assertEquals(0, meta.getTag().size());
}
@Test
public void testMetadata() throws Exception {
HttpGet get = new HttpGet(ourServerBase + "/metadata");
@ -1921,86 +1949,19 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
assertEquals(1, resp.getTotal());
}
@Test
public void testMetaOperations() throws Exception {
String methodName = "testMetaOperations";
Patient pt = new Patient();
pt.addName().setFamily(methodName);
IIdType id = ourClient.create().resource(pt).execute().getId().toUnqualifiedVersionless();
Meta meta = ourClient.meta().get(Meta.class).fromResource(id).execute();
assertEquals(0, meta.getTag().size());
Meta inMeta = new Meta();
inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
meta = ourClient.meta().add().onResource(id).meta(inMeta).execute();
assertEquals(1, meta.getTag().size());
inMeta = new Meta();
inMeta.addTag().setSystem("urn:system1").setCode("urn:code1");
meta = ourClient.meta().delete().onResource(id).meta(inMeta).execute();
assertEquals(0, meta.getTag().size());
}
@Test
public void testMetaOperationWithNoMetaParameter() throws Exception {
Patient p = new Patient();
p.addName().setFamily("testMetaAddInvalid");
IIdType id = ourClient.create().resource(p).execute().getId().toUnqualifiedVersionless();
//@formatter:off
String input = "<Parameters>\n" +
" <meta>\n" +
" <tag>\n" +
" <system value=\"http://example.org/codes/tags\"/>\n" +
" <code value=\"record-lost\"/>\n" +
" <display value=\"Patient File Lost\"/>\n" +
" </tag>\n" +
" </meta>\n" +
"</Parameters>";
//@formatter:on
HttpPost post = new HttpPost(ourServerBase + "/Patient/" + id.getIdPart() + "/$meta-add");
post.setEntity(new StringEntity(input, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
CloseableHttpResponse response = ourHttpClient.execute(post);
try {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(output);
assertEquals(400, response.getStatusLine().getStatusCode());
assertThat(output, containsString("Input contains no parameter with name 'meta'"));
} finally {
response.close();
}
post = new HttpPost(ourServerBase + "/Patient/" + id.getIdPart() + "/$meta-delete");
post.setEntity(new StringEntity(input, ContentType.create(Constants.CT_FHIR_XML, "UTF-8")));
response = ourHttpClient.execute(post);
try {
String output = IOUtils.toString(response.getEntity().getContent(), StandardCharsets.UTF_8);
ourLog.info(output);
assertEquals(400, response.getStatusLine().getStatusCode());
assertThat(output, containsString("Input contains no parameter with name 'meta'"));
} finally {
response.close();
}
}
@Test
public void testPagingOverEverythingSet() throws InterruptedException {
Patient p = new Patient();
p.setActive(true);
String pid = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
for (int i = 0; i < 20; i++) {
Observation o = new Observation();
o.getSubject().setReference(pid);
o.addIdentifier().setSystem("foo").setValue(Integer.toString(i));
myObservationDao.create(o);
}
mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(50);
mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(10);
mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(true);
@ -2013,7 +1974,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnResourceType(Bundle.class)
.useHttpGet()
.execute();
assertEquals(10, response.getEntry().size());
if (response.getTotalElement().getValueAsString() != null) {
assertEquals("21", response.getTotalElement().getValueAsString());
@ -2033,7 +1994,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
// Load page 3
Thread.sleep(2000);
nextUrl = response.getLink("next").getUrl();
response = ourClient.fetchResourceFromUrl(Bundle.class, nextUrl);
@ -2046,18 +2007,18 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
@Test
public void testPagingOverEverythingSetWithNoPagingProvider() throws InterruptedException {
ourRestServer.setPagingProvider(null);
Patient p = new Patient();
p.setActive(true);
String pid = myPatientDao.create(p).getId().toUnqualifiedVersionless().getValue();
for (int i = 0; i < 20; i++) {
Observation o = new Observation();
o.getSubject().setReference(pid);
o.addIdentifier().setSystem("foo").setValue(Integer.toString(i));
myObservationDao.create(o);
}
mySearchCoordinatorSvcRaw.setLoadingThrottleForUnitTests(50);
mySearchCoordinatorSvcRaw.setSyncSizeForUnitTests(10);
mySearchCoordinatorSvcRaw.setNeverUseLocalSearchForUnitTests(true);
@ -2070,7 +2031,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
.returnResourceType(Bundle.class)
.useHttpGet()
.execute();
assertEquals(21, response.getEntry().size());
assertEquals(21, response.getTotalElement().getValue().intValue());
assertEquals(null, response.getLink("next"));
@ -2404,57 +2365,6 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
@Test
public void testSearchByIdentifier() {
Patient p1 = new Patient();
p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01");
p1.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01");
IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId();
Patient p2 = new Patient();
p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02");
p2.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven02");
ourClient.create().resource(p2).execute().getId();
//@formatter:off
Bundle actual = ourClient
.search()
.forResource(Patient.class)
.where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01"))
.encodedJson()
.prettyPrint()
.returnBundle(Bundle.class)
.execute();
//@formatter:on
assertEquals(1, actual.getEntry().size());
assertEquals(ourServerBase + "/Patient/" + p1Id.getIdPart(), actual.getEntry().get(0).getFullUrl());
assertEquals(p1Id.getIdPart(), actual.getEntry().get(0).getResource().getIdElement().getIdPart());
assertEquals(SearchEntryMode.MATCH, actual.getEntry().get(0).getSearch().getModeElement().getValue());
}
@Test
public void testSearchByIdentifierWithoutSystem() {
Patient p1 = new Patient();
p1.addIdentifier().setValue("testSearchByIdentifierWithoutSystem01");
IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId();
//@formatter:off
Bundle actual = ourClient
.search()
.forResource(Patient.class)
.where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01"))
.encodedJson()
.prettyPrint()
.returnBundle(Bundle.class)
.execute();
//@formatter:on
assertEquals(1, actual.getEntry().size());
assertEquals(p1Id.getIdPart(), actual.getEntry().get(0).getResource().getIdElement().getIdPart());
}
@Test
public void testSearchByIdOr() {
IIdType id1;
@ -2539,6 +2449,57 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
@Test
public void testSearchByIdentifier() {
Patient p1 = new Patient();
p1.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier01");
p1.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven01");
IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId();
Patient p2 = new Patient();
p2.addIdentifier().setSystem("urn:system").setValue("testSearchByIdentifier02");
p2.addName().setFamily("testSearchByIdentifierFamily01").addGiven("testSearchByIdentifierGiven02");
ourClient.create().resource(p2).execute().getId();
//@formatter:off
Bundle actual = ourClient
.search()
.forResource(Patient.class)
.where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01"))
.encodedJson()
.prettyPrint()
.returnBundle(Bundle.class)
.execute();
//@formatter:on
assertEquals(1, actual.getEntry().size());
assertEquals(ourServerBase + "/Patient/" + p1Id.getIdPart(), actual.getEntry().get(0).getFullUrl());
assertEquals(p1Id.getIdPart(), actual.getEntry().get(0).getResource().getIdElement().getIdPart());
assertEquals(SearchEntryMode.MATCH, actual.getEntry().get(0).getSearch().getModeElement().getValue());
}
@Test
public void testSearchByIdentifierWithoutSystem() {
Patient p1 = new Patient();
p1.addIdentifier().setValue("testSearchByIdentifierWithoutSystem01");
IdType p1Id = (IdType) ourClient.create().resource(p1).execute().getId();
//@formatter:off
Bundle actual = ourClient
.search()
.forResource(Patient.class)
.where(Patient.IDENTIFIER.exactly().systemAndCode(null, "testSearchByIdentifierWithoutSystem01"))
.encodedJson()
.prettyPrint()
.returnBundle(Bundle.class)
.execute();
//@formatter:on
assertEquals(1, actual.getEntry().size());
assertEquals(p1Id.getIdPart(), actual.getEntry().get(0).getResource().getIdElement().getIdPart());
}
@Test
public void testSearchByLastUpdated() throws Exception {
String methodName = "testSearchByLastUpdated";
@ -2802,6 +2763,31 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
@Test()
public void testSearchNegativeNumbers() throws Exception {
Observation o = new Observation();
o.setValue(new Quantity().setValue(new BigDecimal("-10")));
String oid1 = myObservationDao.create(o, mySrd).getId().toUnqualifiedVersionless().getValue();
Observation o2 = new Observation();
o2.setValue(new Quantity().setValue(new BigDecimal("-20")));
String oid2 = myObservationDao.create(o2, mySrd).getId().toUnqualifiedVersionless().getValue();
HttpGet get = new HttpGet(ourServerBase + "/Observation?value-quantity=gt-15");
CloseableHttpResponse resp = ourHttpClient.execute(get);
try {
assertEquals(200, resp.getStatusLine().getStatusCode());
Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
List<String> ids = toUnqualifiedVersionlessIdValues(bundle);
assertThat(ids, contains(oid1));
assertThat(ids, not(contains(oid2)));
} finally {
IOUtils.closeQuietly(resp);
}
}
@SuppressWarnings("unused")
@Test
public void testSearchPagingKeepsOldSearches() throws Exception {
@ -3233,31 +3219,6 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
}
@Test()
public void testSearchNegativeNumbers() throws Exception {
Observation o = new Observation();
o.setValue(new Quantity().setValue(new BigDecimal("-10")));
String oid1 = myObservationDao.create(o, mySrd).getId().toUnqualifiedVersionless().getValue();
Observation o2 = new Observation();
o2.setValue(new Quantity().setValue(new BigDecimal("-20")));
String oid2 = myObservationDao.create(o2, mySrd).getId().toUnqualifiedVersionless().getValue();
HttpGet get = new HttpGet(ourServerBase + "/Observation?value-quantity=gt-15");
CloseableHttpResponse resp = ourHttpClient.execute(get);
try {
assertEquals(200, resp.getStatusLine().getStatusCode());
Bundle bundle = myFhirCtx.newXmlParser().parseResource(Bundle.class, IOUtils.toString(resp.getEntity().getContent(), Constants.CHARSET_UTF8));
List<String> ids = toUnqualifiedVersionlessIdValues(bundle);
assertThat(ids, contains(oid1));
assertThat(ids, not(contains(oid2)));
} finally {
IOUtils.closeQuietly(resp);
}
}
@Test(expected = InvalidRequestException.class)
public void testSearchWithInvalidSort() throws Exception {
Observation o = new Observation();
@ -3356,12 +3317,12 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
@Test
public void testSearchWithMissingDate2() throws Exception {
MedicationRequest mr1 = new MedicationRequest();
mr1.getCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
mr1.addCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
mr1.addDosageInstruction().getTiming().addEventElement().setValueAsString("2017-01-01");
IIdType id1 = myMedicationRequestDao.create(mr1).getId().toUnqualifiedVersionless();
MedicationRequest mr2 = new MedicationRequest();
mr2.getCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
mr2.addCategory().addCoding().setSystem("urn:medicationroute").setCode("oral");
IIdType id2 = myMedicationRequestDao.create(mr2).getId().toUnqualifiedVersionless();
HttpGet get = new HttpGet(ourServerBase + "/MedicationRequest?date:missing=false");
@ -3381,7 +3342,7 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
/**
* See #411
*
*
* Let's see if we can reproduce this issue in JPA
*/
@Test
@ -3895,6 +3856,41 @@ public class ResourceProviderR4Test extends BaseResourceProviderR4Test {
}
@Test
public void testUpdateThatCreatesReturnsHttp201() throws IOException {
Patient p = new Patient();
p.setId("A");
p.setActive(true);
String encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
HttpPut put = new HttpPut(ourServerBase + "/Patient/A");
put.setEntity(new StringEntity(encoded, "application/fhir+json", "UTF-8"));
CloseableHttpResponse response = ourHttpClient.execute(put);
try {
assertEquals(201, response.getStatusLine().getStatusCode());
} finally {
IOUtils.closeQuietly(response);
}
p = new Patient();
p.setId("A");
p.setActive(false);
encoded = myFhirCtx.newJsonParser().encodeResourceToString(p);
put = new HttpPut(ourServerBase + "/Patient/A");
put.setEntity(new StringEntity(encoded, "application/fhir+json", "UTF-8"));
response = ourHttpClient.execute(put);
try {
assertEquals(200, response.getStatusLine().getStatusCode());
} finally {
IOUtils.closeQuietly(response);
}
}
@Test
public void testUpdateWithClientSuppliedIdWhichDoesntExist() {
Patient p1 = new Patient();

View File

@ -95,9 +95,9 @@ public class RestHookWithEventDefinitionR4Test extends BaseResourceProviderR4Tes
.setPurpose("Monitor all admissions to Emergency")
.setTrigger(new TriggerDefinition()
.setType(TriggerDefinition.TriggerType.DATAADDED)
.setEventCondition(new TriggerDefinition.TriggerDefinitionEventConditionComponent()
.setCondition(new TriggerDefinition.TriggerDefinitionConditionComponent()
.setDescription("Encounter Location = emergency (active/completed encounters, current or previous)")
.setLanguage("text/fhirpath")
.setLanguage(TriggerDefinition.ExpressionLanguage.TEXT_FHIRPATH)
.setExpression("(this | %previous).location.where(location = 'Location/emergency' and status in {'active', 'completed'}).exists()")
)
);

View File

@ -0,0 +1,49 @@
{
"resourceType" : "DocumentManifest",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">Text</div>"
},
"contained" : [
{
"resourceType" : "Practitioner",
"id" : "a1",
"name" : [{
"family" : [
"Dopplemeyer"
],
"given" : [
"Sherry"
]
}],
"telecom" : [
{
"system" : "email",
"value" : "john.doe@healthcare.example.org"
}
]
}
],
"masterIdentifier" : {
"system" : "http://example.org/documents",
"value" : "23425234234-2346"
},
"subject" : [
],
"type" : {
"text" : "History and Physical"
},
"agent" : [
{
"who": {
"reference": "#a1"
}
}
],
"created" : "2004-12-25T23:50:50",
"source" : "urn:oid:1.3.6.1.4.1.21367.2009.1.2.1",
"status" : "current",
"description" : "Physical",
"content" : [
]
}

View File

@ -0,0 +1,101 @@
{
"resourceType" : "DocumentReference",
"text" : {
"status" : "generated",
"div" : "<div xmlns=\"http://www.w3.org/1999/xhtml\">&#xA; <p>&#xA; <b>Generated Narrative</b>&#xA; </p>&#xA; <p>&#xA; <b>masterIdentifier</b>: urn:oid:1.3.6.1.4.1.21367.2005.3.7&#xA; </p>&#xA; <p>&#xA; <b>subject</b>: &#xA; <a href=\"Patient/xcda\">MRN = 12345 (usual); Henry Levin ; Male; birthDate: 24-Sep 1932; active</a>&#xA; </p>&#xA; <p>&#xA; <b>type</b>: &#xA; <span title=\"Codes: {http://loinc.org 34108-1}\">Outpatient Note</span>&#xA; </p>&#xA; <p>&#xA; <b>author</b>: Sherry Dopplemeyer ; Primary Surgon; Orthopedic, Gerald Smitty ; Attending; Orthopedic&#xA; </p>&#xA; <p>&#xA; <b>created</b>: 24-Dec 2005 9:35&#xA; </p>&#xA; <p>&#xA; <b>indexed</b>: 24-Dec 2005 9:43&#xA; </p>&#xA; <p>&#xA; <b>status</b>: current&#xA; </p>&#xA; <p>&#xA; <b>description</b>: Physical&#xA; </p>&#xA; <p>&#xA; <b>confidentiality</b>: &#xA; <span title=\"Codes: {http://ihe.net/xds/connectathon/confidentialityCodes 1.3.6.1.4.1.21367.2006.7.101}\">Clinical-Staff</span>&#xA; </p>&#xA; <p>&#xA; <b>primaryLanguage</b>: en-US&#xA; </p>&#xA; <p>&#xA; <b>mimeType</b>: application/hl7-v3+xml&#xA; </p>&#xA; <p>&#xA; <b>size</b>: 3654&#xA; </p>&#xA; <p>&#xA; <b>hash</b>: da39a3ee5e6b4b0d3255bfef95601890afd80709&#xA; </p>&#xA; <p>&#xA; <b>location</b>: &#xA; <a href=\"http://example.org/xds/mhd/Binary/@07a6483f-732b-461e-86b6-edb665c45510\">http://example.org/xds/mhd/Binary/@07a6483f-732b-461e-86b6-edb665c45510</a>&#xA; </p>&#xA; <h3>Contexts</h3>&#xA; <table class=\"grid\">&#xA; <tr>&#xA; <td>&#xA; <b>Event</b>&#xA; </td>&#xA; <td>&#xA; <b>Period</b>&#xA; </td>&#xA; <td>&#xA; <b>FacilityType</b>&#xA; </td>&#xA; </tr>&#xA; <tr>&#xA; <td>&#xA; <span title=\"Codes: {http://ihe.net/xds/connectathon/eventCodes T-D8200}\">Arm</span>&#xA; </td>&#xA; <td>23-Dec 2004 8:0 --&gt; 23-Dec 2004 8:1</td>&#xA; <td>&#xA; <span title=\"Codes: {http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes Outpatient}\">Outpatient</span>&#xA; </td>&#xA; </tr>&#xA; </table>&#xA; </div>"
},
"contained" : [
{
"resourceType" : "Practitioner",
"id" : "a1",
"name" : [{
"family" : [
"Dopplemeyer"
],
"given" : [
"Sherry"
]
}],
"telecom" : [
{
"system" : "email",
"value" : "john.doe@healthcare.example.org"
}
]
},
{
"resourceType" : "Practitioner",
"id" : "a2",
"name" : [{
"family" : [
"Smitty"
],
"given" : [
"Gerald"
]
}],
"telecom" : [
{
"system" : "email",
"value" : "john.doe@healthcare.example.org"
}
]
}
],
"masterIdentifier" : {
"system" : "urn:ietf:rfc:3986",
"value" : "urn:oid:1.3.6.1.4.1.21367.2005.3.7"
},
"subject" : {
},
"type" : {
"coding" : [
{
"system" : "http://loinc.org",
"code" : "34108-1",
"display" : "Outpatient Note"
}
]
},
"agent" : [
{
"who": {
"reference": "#a1"
}
},
{
"who": {
"reference": "#a2"
}
}
],
"created" : "2005-12-24T09:35:00+11:00",
"status" : "current",
"description" : "Physical",
"context" : {
"event" : [
{
"coding" : [
{
"system" : "http://ihe.net/xds/connectathon/eventCodes",
"code" : "T-D8200",
"display" : "Arm"
}
]
}
],
"period" : {
"start" : "2004-12-23T08:00:00",
"end" : "2004-12-23T08:01:00"
},
"facilityType" : {
"coding" : [
{
"system" : "http://www.ihe.net/xds/connectathon/healthcareFacilityTypeCodes",
"code" : "Outpatient",
"display" : "Outpatient"
}
]
}
}
}

View File

@ -10,7 +10,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-fhir</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -4,7 +4,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -1,8 +1,18 @@
package org.hl7.fhir.dstu3.utils;
import org.hl7.fhir.dstu3.context.IWorkerContext;
import org.hl7.fhir.dstu3.model.DomainResource;
public class NarrativeGenerator {
public static String describeSystem(String theSystem) {
public NarrativeGenerator(String theS, String theS1, IWorkerContext theContext) {
}
public void generate(DomainResource theR) {
}
public static String describeSystem(String theSystem) {
return theSystem;
}

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -5,7 +5,7 @@
<parent>
<groupId>ca.uhn.hapi.fhir</groupId>
<artifactId>hapi-deployable-pom</artifactId>
<version>3.0.0-SNAPSHOT</version>
<version>3.0.0</version>
<relativePath>../hapi-deployable-pom/pom.xml</relativePath>
</parent>

View File

@ -361,7 +361,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// we actually delegate the work to a subroutine so we can re-enter it with a different cursors
processPaths("", derived.getSnapshot(), base.getSnapshot(), derived.getDifferential(), baseCursor, diffCursor, base.getSnapshot().getElement().size()-1,
derived.getDifferential().hasElement() ? derived.getDifferential().getElement().size()-1 : -1, url, derived.getId(), null, null, false, base.getUrl(), null, false);
derived.getDifferential().hasElement() ? derived.getDifferential().getElement().size()-1 : -1, url, derived.getId(), null, null, false, base.getUrl(), null, false, null);
if (!derived.getSnapshot().getElementFirstRep().getType().isEmpty())
throw new Error("type on first snapshot element for "+derived.getSnapshot().getElementFirstRep().getPath()+" in "+derived.getUrl()+" from "+base.getUrl());
updateMaps(base, derived);
@ -379,7 +379,7 @@ public class ProfileUtilities extends TranslatingUtilities {
for (ElementDefinition e : derived.getDifferential().getElement()) {
if (!e.hasUserData(GENERATED_IN_SNAPSHOT)) {
System.out.println("Error in snapshot generation: Differential for "+derived.getUrl()+" with id: " + e.getId()+" has an element that is not marked with a snapshot match");
throw new DefinitionException("Snapshot for "+derived.getUrl()+" does not contain differential element with id: " + e.getId());
throw new DefinitionException("Snapshot for "+derived.getUrl()+" does not contain an element that matches an existing differential element that has id: " + e.getId());
// System.out.println("**BAD Differential element: " + profileName + ":" + e.getId());
}
}
@ -468,7 +468,7 @@ public class ProfileUtilities extends TranslatingUtilities {
* @throws Exception
*/
private ElementDefinition processPaths(String indent, StructureDefinitionSnapshotComponent result, StructureDefinitionSnapshotComponent base, StructureDefinitionDifferentialComponent differential, int baseCursor, int diffCursor, int baseLimit,
int diffLimit, String url, String profileName, String contextPathSrc, String contextPathDst, boolean trimDifferential, String contextName, String resultPathBase, boolean slicingDone) throws DefinitionException, FHIRException {
int diffLimit, String url, String profileName, String contextPathSrc, String contextPathDst, boolean trimDifferential, String contextName, String resultPathBase, boolean slicingDone, ElementDefinition redirector) throws DefinitionException, FHIRException {
if (DEBUG)
System.out.println(indent+"PP @ "+resultPathBase+": base = "+baseCursor+" to "+baseLimit+", diff = "+diffCursor+" to "+diffLimit+" (slicing = "+slicingDone+")");
ElementDefinition res = null;
@ -476,7 +476,7 @@ public class ProfileUtilities extends TranslatingUtilities {
while (baseCursor <= baseLimit) {
// get the current focus of the base, and decide what to do
ElementDefinition currentBase = base.getElement().get(baseCursor);
String cpath = fixedPath(contextPathSrc, currentBase.getPath());
String cpath = fixedPathSource(contextPathSrc, currentBase.getPath(), redirector);
if (DEBUG)
System.out.println(indent+" - "+cpath+": base = "+baseCursor+" to "+baseLimit+", diff = "+diffCursor+" to "+diffLimit+" (slicingDone = "+slicingDone+")");
List<ElementDefinition> diffMatches = getDiffMatches(differential, cpath, diffCursor, diffLimit, profileName, url); // get a list of matching elements in scope
@ -486,7 +486,7 @@ public class ProfileUtilities extends TranslatingUtilities {
if (diffMatches.isEmpty()) { // the differential doesn't say anything about this item
// so we just copy it in
ElementDefinition outcome = updateURLs(url, currentBase.copy());
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
updateFromBase(outcome, currentBase);
markDerived(outcome);
if (resultPathBase == null)
@ -510,7 +510,7 @@ public class ProfileUtilities extends TranslatingUtilities {
while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), cpath+"."))
diffCursor++;
processPaths(indent+" ", result, dt.getSnapshot(), differential, 1 /* starting again on the data type, but skip the root */, start, dt.getSnapshot().getElement().size()-1,
diffCursor-1, url, profileName, cpath, outcome.getPath(), trimDifferential, contextName, resultPathBase, false);
diffCursor-1, url, profileName, cpath, outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null);
}
baseCursor++;
} else if (diffMatches.size() == 1 && (slicingDone || !(diffMatches.get(0).hasSlicing() || (isExtension(diffMatches.get(0)) && diffMatches.get(0).hasSliceName())))) {// one matching element in the differential
@ -541,7 +541,7 @@ public class ProfileUtilities extends TranslatingUtilities {
template = overWriteWithCurrent(template, currentBase);
ElementDefinition outcome = updateURLs(url, template);
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
res = outcome;
updateFromBase(outcome, currentBase);
if (diffMatches.get(0).hasSliceName())
@ -590,14 +590,14 @@ public class ProfileUtilities extends TranslatingUtilities {
int nbl = nbc;
while (nbl < base.getElement().size() && base.getElement().get(nbl).getPath().startsWith(tgt.getPath()+"."))
nbl++;
processPaths(indent+" ", result, base, differential, nbc, start - 1, nbl-1, diffCursor - 1, url, profileName, tgt.getPath(), diffMatches.get(0).getPath(), trimDifferential, contextName, resultPathBase, false);
processPaths(indent+" ", result, base, differential, nbc, start - 1, nbl-1, diffCursor - 1, url, profileName, tgt.getPath(), diffMatches.get(0).getPath(), trimDifferential, contextName, resultPathBase, false, outcome);
} else {
StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));
if (dt == null)
throw new DefinitionException(diffMatches.get(0).getPath()+" has children ("+differential.getElement().get(diffCursor).getPath()+") for type "+typeCode(outcome.getType())+" in profile "+profileName+", but can't find type");
contextName = dt.getUrl();
processPaths(indent+" ", result, dt.getSnapshot(), differential, 1 /* starting again on the data type, but skip the root */, start, dt.getSnapshot().getElement().size()-1,
diffCursor - 1, url, profileName+pathTail(diffMatches, 0), diffMatches.get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false);
diffCursor - 1, url, profileName+pathTail(diffMatches, 0), diffMatches.get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null);
}
}
}
@ -617,12 +617,12 @@ public class ProfileUtilities extends TranslatingUtilities {
if (diffMatches.size() > 1 && diffMatches.get(0).hasSlicing() && (nbl > baseCursor || differential.getElement().indexOf(diffMatches.get(1)) > differential.getElement().indexOf(diffMatches.get(0))+1)) {
int ndc = differential.getElement().indexOf(diffMatches.get(0));
int ndl = findEndOfElement(differential, ndc);
processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, 0), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true).setSlicing(diffMatches.get(0).getSlicing());
processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, 0), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true, null).setSlicing(diffMatches.get(0).getSlicing());
start++;
} else {
// we're just going to accept the differential slicing at face value
ElementDefinition outcome = updateURLs(url, currentBase.copy());
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
updateFromBase(outcome, currentBase);
if (!diffMatches.get(0).hasSlicing())
@ -658,7 +658,7 @@ public class ProfileUtilities extends TranslatingUtilities {
continue;
}*/
// now we process the base scope repeatedly for each instance of the item in the differential list
processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, i), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true);
processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, i), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true, null);
}
// ok, done with that - next in the base list
baseCursor = nbl+1;
@ -680,7 +680,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// copy across the currentbase, and all of its children and siblings
while (baseCursor < base.getElement().size() && base.getElement().get(baseCursor).getPath().startsWith(path)) {
ElementDefinition outcome = updateURLs(url, base.getElement().get(baseCursor).copy());
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path in profile " + profileName + ": "+outcome.getPath()+" vs " + resultPathBase);
result.getElement().add(outcome); // so we just copy it in
@ -704,9 +704,9 @@ public class ProfileUtilities extends TranslatingUtilities {
throw new DefinitionException("Slicing rules on differential ("+summariseSlicing(dSlice)+") do not match those on base ("+summariseSlicing(bSlice)+") - rule @ "+path+" ("+contextName+")");
}
ElementDefinition outcome = updateURLs(url, currentBase.copy());
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
updateFromBase(outcome, currentBase);
if (diffMatches.get(0).hasSlicing() /*&& !isExtension*/) {
if (diffMatches.get(0).hasSlicing() || !diffMatches.get(0).hasSliceName()) {
updateFromSlicing(outcome.getSlicing(), diffMatches.get(0).getSlicing());
updateFromDefinition(outcome, diffMatches.get(0), profileName, closed, url); // if there's no slice, we don't want to update the unsliced description
} else if (!diffMatches.get(0).hasSliceName())
@ -721,7 +721,7 @@ public class ProfileUtilities extends TranslatingUtilities {
int nbl = findEndOfElement(base, baseCursor);
int ndc = differential.getElement().indexOf(diffMatches.get(0));
int ndl = findEndOfElement(differential, ndc);
processPaths(indent+" ", result, base, differential, baseCursor+1, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, 0), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true);
processPaths(indent+" ", result, base, differential, baseCursor+1, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, 0), contextPathSrc, contextPathDst, trimDifferential, contextName, resultPathBase, true, null);
// throw new Error("Not done yet");
}
@ -731,7 +731,7 @@ public class ProfileUtilities extends TranslatingUtilities {
baseCursor = base.getElement().indexOf(baseItem);
outcome = updateURLs(url, baseItem.copy());
updateFromBase(outcome, currentBase);
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
outcome.setSlicing(null);
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
@ -743,7 +743,7 @@ public class ProfileUtilities extends TranslatingUtilities {
int ndc = differential.getElement().indexOf(diffMatches.get(diffpos));
int ndl = findEndOfElement(differential, ndc);
// now we process the base scope repeatedly for each instance of the item in the differential list
processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, diffpos), contextPathSrc, contextPathDst, closed, contextName, resultPathBase, true);
processPaths(indent+" ", result, base, differential, baseCursor, ndc, nbl, ndl, url, profileName+pathTail(diffMatches, diffpos), contextPathSrc, contextPathDst, closed, contextName, resultPathBase, true, null);
// ok, done with that - now set the cursors for if this is the end
baseCursor = nbl;
diffCursor = ndl+1;
@ -754,7 +754,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// just copy any children on the base
while (baseCursor < base.getElement().size() && base.getElement().get(baseCursor).getPath().startsWith(path) && !base.getElement().get(baseCursor).getPath().equals(path)) {
outcome = updateURLs(url, base.getElement().get(baseCursor).copy());
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
if (!outcome.getPath().startsWith(resultPathBase))
throw new DefinitionException("Adding wrong path");
result.getElement().add(outcome);
@ -778,7 +778,7 @@ public class ProfileUtilities extends TranslatingUtilities {
throw new DefinitionException("Named items are out of order in the slice");
outcome = updateURLs(url, currentBase.copy());
// outcome = updateURLs(url, diffItem.copy());
outcome.setPath(fixedPath(contextPathDst, outcome.getPath()));
outcome.setPath(fixedPathDest(contextPathDst, outcome.getPath(), redirector));
updateFromBase(outcome, currentBase);
outcome.setSlicing(null);
if (!outcome.getPath().startsWith(resultPathBase))
@ -807,7 +807,7 @@ public class ProfileUtilities extends TranslatingUtilities {
while (differential.getElement().size() > diffCursor && pathStartsWith(differential.getElement().get(diffCursor).getPath(), diffMatches.get(0).getPath()+"."))
diffCursor++;
processPaths(indent+" ", result, dt.getSnapshot(), differential, 1 /* starting again on the data type, but skip the root */, start-1, dt.getSnapshot().getElement().size()-1,
diffCursor - 1, url, profileName+pathTail(diffMatches, 0), diffMatches.get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false);
diffCursor - 1, url, profileName+pathTail(diffMatches, 0), diffMatches.get(0).getPath(), outcome.getPath(), trimDifferential, contextName, resultPathBase, false, null);
} else if (outcome.getType().get(0).getCode().equals("Extension")) {
// Force URL to appear if we're dealing with an extension. (This is a kludge - may need to drill down in other cases where we're slicing and the type has a profile declaration that could be setting the fixed value)
StructureDefinition dt = getProfileForDataType(outcome.getType().get(0));
@ -815,7 +815,7 @@ public class ProfileUtilities extends TranslatingUtilities {
// We only want the children that aren't the root
if (extEd.getPath().contains(".")) {
ElementDefinition extUrlEd = updateURLs(url, extEd.copy());
extUrlEd.setPath(fixedPath(outcome.getPath(), extUrlEd.getPath()));
extUrlEd.setPath(fixedPathDest(outcome.getPath(), extUrlEd.getPath(), null));
// updateFromBase(extUrlEd, currentBase);
markDerived(extUrlEd);
result.getElement().add(extUrlEd);
@ -997,12 +997,28 @@ public class ProfileUtilities extends TranslatingUtilities {
}
private String fixedPath(String contextPath, String pathSimple) {
private String fixedPathSource(String contextPath, String pathSimple, ElementDefinition redirector) {
if (contextPath == null)
return pathSimple;
return contextPath+"."+pathSimple.substring(pathSimple.indexOf(".")+1);
String ptail = pathSimple.substring(pathSimple.indexOf(".")+1);
if (redirector != null)
return contextPath+"."+tail(redirector.getPath())+"."+ptail.substring(ptail.indexOf(".")+1);
else
return contextPath+"."+ptail;
}
private String fixedPathDest(String contextPath, String pathSimple, ElementDefinition redirector) {
if (contextPath == null)
return pathSimple;
String ptail = pathSimple.substring(pathSimple.indexOf(".")+1);
if (redirector != null) {
ptail = ptail.substring(ptail.indexOf(".")+1);
// ptail = ptail.substring(ptail.indexOf(".")+1);
return contextPath+"."+/*tail(redirector.getPath())+"."+*/ptail;
} else
return contextPath+"."+ptail;
}
private StructureDefinition getProfileForDataType(TypeRefComponent type) {
StructureDefinition sd = null;
@ -1125,7 +1141,7 @@ public class ProfileUtilities extends TranslatingUtilities {
private boolean ruleMatches(SlicingRules diff, SlicingRules base) {
return (diff == null) || (base == null) || (diff == base) || (diff == SlicingRules.OPEN) ||
return (diff == null) || (base == null) || (diff == base) || (base == SlicingRules.OPEN) ||
((diff == SlicingRules.OPENATEND && base == SlicingRules.CLOSED));
}
@ -1221,19 +1237,21 @@ public class ProfileUtilities extends TranslatingUtilities {
// Before applying changes, apply them to what's in the profile
// TODO: follow Chris's rules
StructureDefinition profile = source.getType().size() == 1 && source.getTypeFirstRep().hasProfile() ? context.fetchResource(StructureDefinition.class, source.getTypeFirstRep().getProfile()) : null;
if (profile != null) {
ElementDefinition e = profile.getSnapshot().getElement().get(0);
base.setDefinition(e.getDefinition());
base.setShort(e.getShort());
if (e.hasCommentElement())
base.setCommentElement(e.getCommentElement());
if (e.hasRequirementsElement())
base.setRequirementsElement(e.getRequirementsElement());
base.getAlias().clear();
base.getAlias().addAll(e.getAlias());
base.getMapping().clear();
base.getMapping().addAll(e.getMapping());
if (base.hasSliceName()) {
StructureDefinition profile = source.getType().size() == 1 && source.getTypeFirstRep().hasProfile() ? context.fetchResource(StructureDefinition.class, source.getTypeFirstRep().getProfile()) : null;
if (profile != null) {
ElementDefinition e = profile.getSnapshot().getElement().get(0);
base.setDefinition(e.getDefinition());
base.setShort(e.getShort());
if (e.hasCommentElement())
base.setCommentElement(e.getCommentElement());
if (e.hasRequirementsElement())
base.setRequirementsElement(e.getRequirementsElement());
base.getAlias().clear();
base.getAlias().addAll(e.getAlias());
base.getMapping().clear();
base.getMapping().addAll(e.getMapping());
}
}
if (derived != null) {
@ -2817,7 +2835,14 @@ public class ProfileUtilities extends TranslatingUtilities {
return i;
}
if (path.startsWith(p+".") && snapshot.get(i).hasContentReference()) {
actual = base+(snapshot.get(i).getContentReference().substring(1)+"."+path.substring(p.length()+1)).substring(prefixLength);
String ref = snapshot.get(i).getContentReference();
if (ref.substring(1, 2).toUpperCase().equals(ref.substring(1,2)))
actual = base+(ref.substring(1)+"."+path.substring(p.length()+1)).substring(prefixLength);
else {
// Older versions of FHIR (e.g. 2016May) had reference of the style #parameter instead of #Parameters.parameter, so we have to handle that
actual = base+(path.substring(0, path.indexOf(".")+1) + ref.substring(1)+"."+path.substring(p.length()+1)).substring(prefixLength);
}
i = 0;
}
}

View File

@ -266,6 +266,7 @@ public abstract class BaseWorkerContext implements IWorkerContext {
if (canRunWithoutTerminology) {
noTerminologyServer = true;
log("==============!! Running without terminology server !!==============");
log("Error: "+e.getMessage());
return false;
} else
throw new TerminologyServiceException(e);
@ -772,9 +773,8 @@ public abstract class BaseWorkerContext implements IWorkerContext {
}
}
public void initTS(String cachePath, String tsServer) throws Exception {
public void initTS(String cachePath) throws Exception {
cache = cachePath;
this.tsServer = tsServer;
expansionCache = new ValueSetExpansionCache(this, null);
validationCachePath = Utilities.path(cachePath, "validation.cache");
try {

View File

@ -179,11 +179,16 @@ public class SimpleWorkerContext extends BaseWorkerContext implements IWorkerCon
loadBytes(name, stream);
}
public String connectToTSServer(String url) throws URISyntaxException {
txServer = new FHIRToolingClient(url);
txServer.setTimeout(30000);
return txServer.getCapabilitiesStatementQuick().getSoftware().getVersion();
}
public String connectToTSServer(String url) throws URISyntaxException {
txServer = new FHIRToolingClient(url);
txServer.setTimeout(30000);
return txServer.getCapabilitiesStatementQuick().getSoftware().getVersion();
}
public String connectToTSServer(FHIRToolingClient client) throws URISyntaxException {
txServer = client;
return txServer.getCapabilitiesStatementQuick().getSoftware().getVersion();
}
public void loadFromFile(InputStream stream, String name, IContextResourceLoader loader) throws IOException, FHIRException {
Resource f;

View File

@ -255,12 +255,19 @@ public class Property {
}
}
if (!"xhtml".equals(t)) {
final String url;
if (StringUtils.isNotBlank(ed.getType().get(0).getProfile())) {
url = ed.getType().get(0).getProfile();
} else {
url = "http://hl7.org/fhir/StructureDefinition/" + t;
String url = null;
for (TypeRefComponent aType: ed.getType()) {
if (aType.getCode().equals(t)) {
if (StringUtils.isNotBlank(aType.getProfile())) {
url = aType.getProfile();
} else {
url = "http://hl7.org/fhir/StructureDefinition/" + t;
}
break;
}
}
if (url==null)
throw new Error("Unable to find type " + t + " for element " + elementName + " with path " + ed.getPath());
sd = context.fetchResource(StructureDefinition.class, url);
if (sd == null)
throw new DefinitionException("Unable to find type '"+t+"' for name '"+elementName+"' on property "+definition.getPath());

View File

@ -51,14 +51,6 @@ public class GraphQLProvider {
myStorageServices = theStorageServices;
}
@Initialize
public void initialize(RestfulServer theServer) {
ourLog.trace("Initializing GraphQL provider");
if (theServer.getFhirContext().getVersion().getVersion() != FhirVersionEnum.R4) {
throw new ConfigurationException("Can not use " + getClass().getName() + " provider on server with FHIR " + theServer.getFhirContext().getVersion().getVersion().name() + " context");
}
}
@GraphQL
public String graphql(ServletRequestDetails theRequestDetails, @IdParam IIdType theId, @GraphQLQuery String theQuery) {
@ -89,6 +81,14 @@ public class GraphQLProvider {
}
}
@Initialize
public void initialize(RestfulServer theServer) {
ourLog.trace("Initializing GraphQL provider");
if (theServer.getFhirContext().getVersion().getVersion() != FhirVersionEnum.R4) {
throw new ConfigurationException("Can not use " + getClass().getName() + " provider on server with FHIR " + theServer.getFhirContext().getVersion().getVersion().name() + " context");
}
}
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -107,6 +107,10 @@ public class ActivityDefinition extends MetadataResource {
* The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.
*/
CARETEAM,
/**
* Catalog entries are wrappers that contextualize items included in a catalog.
*/
CATALOGENTRY,
/**
* The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.
*/
@ -235,6 +239,10 @@ public class ActivityDefinition extends MetadataResource {
* The EventDefinition resource provides a reusable description of when a particular event can occur.
*/
EVENTDEFINITION,
/**
* Example of workflow instance.
*/
EXAMPLESCENARIO,
/**
* Resource to define constraints on the Expansion of a FHIR ValueSet.
*/
@ -336,7 +344,7 @@ public class ActivityDefinition extends MetadataResource {
*/
MEDICATIONREQUEST,
/**
* A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information.
* A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. The primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information.
*/
MEDICATIONSTATEMENT,
/**
@ -479,6 +487,10 @@ public class ActivityDefinition extends MetadataResource {
* A sample to be used for analysis.
*/
SPECIMEN,
/**
* A kind of specimen with associated set of requirements.
*/
SPECIMENDEFINITION,
/**
* A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.
*/
@ -558,6 +570,8 @@ public class ActivityDefinition extends MetadataResource {
return CAREPLAN;
if ("CareTeam".equals(codeString))
return CARETEAM;
if ("CatalogEntry".equals(codeString))
return CATALOGENTRY;
if ("ChargeItem".equals(codeString))
return CHARGEITEM;
if ("Claim".equals(codeString))
@ -622,6 +636,8 @@ public class ActivityDefinition extends MetadataResource {
return EPISODEOFCARE;
if ("EventDefinition".equals(codeString))
return EVENTDEFINITION;
if ("ExampleScenario".equals(codeString))
return EXAMPLESCENARIO;
if ("ExpansionProfile".equals(codeString))
return EXPANSIONPROFILE;
if ("ExplanationOfBenefit".equals(codeString))
@ -744,6 +760,8 @@ public class ActivityDefinition extends MetadataResource {
return SLOT;
if ("Specimen".equals(codeString))
return SPECIMEN;
if ("SpecimenDefinition".equals(codeString))
return SPECIMENDEFINITION;
if ("StructureDefinition".equals(codeString))
return STRUCTUREDEFINITION;
if ("StructureMap".equals(codeString))
@ -787,6 +805,7 @@ public class ActivityDefinition extends MetadataResource {
case CAPABILITYSTATEMENT: return "CapabilityStatement";
case CAREPLAN: return "CarePlan";
case CARETEAM: return "CareTeam";
case CATALOGENTRY: return "CatalogEntry";
case CHARGEITEM: return "ChargeItem";
case CLAIM: return "Claim";
case CLAIMRESPONSE: return "ClaimResponse";
@ -819,6 +838,7 @@ public class ActivityDefinition extends MetadataResource {
case ENROLLMENTRESPONSE: return "EnrollmentResponse";
case EPISODEOFCARE: return "EpisodeOfCare";
case EVENTDEFINITION: return "EventDefinition";
case EXAMPLESCENARIO: return "ExampleScenario";
case EXPANSIONPROFILE: return "ExpansionProfile";
case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit";
case FAMILYMEMBERHISTORY: return "FamilyMemberHistory";
@ -880,6 +900,7 @@ public class ActivityDefinition extends MetadataResource {
case SERVICEDEFINITION: return "ServiceDefinition";
case SLOT: return "Slot";
case SPECIMEN: return "Specimen";
case SPECIMENDEFINITION: return "SpecimenDefinition";
case STRUCTUREDEFINITION: return "StructureDefinition";
case STRUCTUREMAP: return "StructureMap";
case SUBSCRIPTION: return "Subscription";
@ -910,6 +931,7 @@ public class ActivityDefinition extends MetadataResource {
case CAPABILITYSTATEMENT: return "http://hl7.org/fhir/resource-types";
case CAREPLAN: return "http://hl7.org/fhir/resource-types";
case CARETEAM: return "http://hl7.org/fhir/resource-types";
case CATALOGENTRY: return "http://hl7.org/fhir/resource-types";
case CHARGEITEM: return "http://hl7.org/fhir/resource-types";
case CLAIM: return "http://hl7.org/fhir/resource-types";
case CLAIMRESPONSE: return "http://hl7.org/fhir/resource-types";
@ -942,6 +964,7 @@ public class ActivityDefinition extends MetadataResource {
case ENROLLMENTRESPONSE: return "http://hl7.org/fhir/resource-types";
case EPISODEOFCARE: return "http://hl7.org/fhir/resource-types";
case EVENTDEFINITION: return "http://hl7.org/fhir/resource-types";
case EXAMPLESCENARIO: return "http://hl7.org/fhir/resource-types";
case EXPANSIONPROFILE: return "http://hl7.org/fhir/resource-types";
case EXPLANATIONOFBENEFIT: return "http://hl7.org/fhir/resource-types";
case FAMILYMEMBERHISTORY: return "http://hl7.org/fhir/resource-types";
@ -1003,6 +1026,7 @@ public class ActivityDefinition extends MetadataResource {
case SERVICEDEFINITION: return "http://hl7.org/fhir/resource-types";
case SLOT: return "http://hl7.org/fhir/resource-types";
case SPECIMEN: return "http://hl7.org/fhir/resource-types";
case SPECIMENDEFINITION: return "http://hl7.org/fhir/resource-types";
case STRUCTUREDEFINITION: return "http://hl7.org/fhir/resource-types";
case STRUCTUREMAP: return "http://hl7.org/fhir/resource-types";
case SUBSCRIPTION: return "http://hl7.org/fhir/resource-types";
@ -1033,6 +1057,7 @@ public class ActivityDefinition extends MetadataResource {
case CAPABILITYSTATEMENT: return "A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of actual server functionality or a statement of required or desired server implementation.";
case CAREPLAN: return "Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or community for a period of time, possibly limited to care for a specific condition or set of conditions.";
case CARETEAM: return "The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care for a patient.";
case CATALOGENTRY: return "Catalog entries are wrappers that contextualize items included in a catalog.";
case CHARGEITEM: return "The resource ChargeItem describes the provision of healthcare provider products for a certain patient, therefore referring not only to the product, but containing in addition details of the provision, like date, time, amounts and participating organizations and persons. Main Usage of the ChargeItem is to enable the billing process and internal cost allocation.";
case CLAIM: return "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.";
case CLAIMRESPONSE: return "This resource provides the adjudication details from the processing of a Claim resource.";
@ -1065,6 +1090,7 @@ public class ActivityDefinition extends MetadataResource {
case ENROLLMENTRESPONSE: return "This resource provides enrollment and plan details from the processing of an Enrollment resource.";
case EPISODEOFCARE: return "An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. The managing organization assumes a level of responsibility for the patient during this time.";
case EVENTDEFINITION: return "The EventDefinition resource provides a reusable description of when a particular event can occur.";
case EXAMPLESCENARIO: return "Example of workflow instance.";
case EXPANSIONPROFILE: return "Resource to define constraints on the Expansion of a FHIR ValueSet.";
case EXPLANATIONOFBENEFIT: return "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.";
case FAMILYMEMBERHISTORY: return "Significant health conditions for a person related to the patient relevant in the context of care for the patient.";
@ -1090,7 +1116,7 @@ public class ActivityDefinition extends MetadataResource {
case MEDICATIONADMINISTRATION: return "Describes the event of a patient consuming or otherwise being administered 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.";
case MEDICATIONDISPENSE: return "Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a description of the medication product (supply) provided and the instructions for administering the medication. The medication dispense is the result of a pharmacy system responding to a medication order.";
case MEDICATIONREQUEST: return "An order or request for both supply of the medication and the instructions for administration of the medication to a patient. The resource is called \"MedicationRequest\" rather than \"MedicationPrescription\" or \"MedicationOrder\" to generalize the use across inpatient and outpatient settings, including care plans, etc., and to harmonize with workflow patterns.";
case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information.";
case MEDICATIONSTATEMENT: return "A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. The source of this information can be the patient, significant other (such as a family member or spouse), or a clinician. A common scenario where this information is captured is during the history taking process during a patient visit or stay. The medication information may come from sources such as the patient's memory, from a prescription bottle, or from a list of medications the patient, clinician or other party maintains. \r\rThe primary difference between a medication statement and a medication administration is that the medication administration has complete administration information and is based on actual administration information from the person who administered the medication. A medication statement is often, if not always, less specific. There is no required date/time when the medication was administered, in fact we only know that a source has reported the patient is taking this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication administration is more formal and is not missing detailed information.";
case MESSAGEDEFINITION: return "Defines the characteristics of a message that can be shared between systems, including the type of event that initiates the message, the content to be transmitted and what response(s), if any, are permitted.";
case MESSAGEHEADER: return "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.";
case NAMINGSYSTEM: return "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.";
@ -1126,6 +1152,7 @@ public class ActivityDefinition extends MetadataResource {
case SERVICEDEFINITION: return "The ServiceDefinition describes a unit of decision support functionality that is made available as a service, such as immunization modules or drug-drug interaction checking.";
case SLOT: return "A slot of time on a schedule that may be available for booking appointments.";
case SPECIMEN: return "A sample to be used for analysis.";
case SPECIMENDEFINITION: return "A kind of specimen with associated set of requirements.";
case STRUCTUREDEFINITION: return "A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in FHIR, and also for describing extensions and constraints on resources and data types.";
case STRUCTUREMAP: return "A Map of relationships between 2 structures that can be used to transform data.";
case SUBSCRIPTION: return "The subscription resource is used to define a push based subscription from a server to another system. Once a subscription is registered with the server, the server checks every resource that is created or updated, and if the resource matches the given criteria, it sends a message on the defined \"channel\" so that another system is able to take an appropriate action.";
@ -1156,6 +1183,7 @@ public class ActivityDefinition extends MetadataResource {
case CAPABILITYSTATEMENT: return "CapabilityStatement";
case CAREPLAN: return "CarePlan";
case CARETEAM: return "CareTeam";
case CATALOGENTRY: return "CatalogEntry";
case CHARGEITEM: return "ChargeItem";
case CLAIM: return "Claim";
case CLAIMRESPONSE: return "ClaimResponse";
@ -1188,6 +1216,7 @@ public class ActivityDefinition extends MetadataResource {
case ENROLLMENTRESPONSE: return "EnrollmentResponse";
case EPISODEOFCARE: return "EpisodeOfCare";
case EVENTDEFINITION: return "EventDefinition";
case EXAMPLESCENARIO: return "ExampleScenario";
case EXPANSIONPROFILE: return "ExpansionProfile";
case EXPLANATIONOFBENEFIT: return "ExplanationOfBenefit";
case FAMILYMEMBERHISTORY: return "FamilyMemberHistory";
@ -1249,6 +1278,7 @@ public class ActivityDefinition extends MetadataResource {
case SERVICEDEFINITION: return "ServiceDefinition";
case SLOT: return "Slot";
case SPECIMEN: return "Specimen";
case SPECIMENDEFINITION: return "SpecimenDefinition";
case STRUCTUREDEFINITION: return "StructureDefinition";
case STRUCTUREMAP: return "StructureMap";
case SUBSCRIPTION: return "Subscription";
@ -1298,6 +1328,8 @@ public class ActivityDefinition extends MetadataResource {
return ActivityDefinitionKind.CAREPLAN;
if ("CareTeam".equals(codeString))
return ActivityDefinitionKind.CARETEAM;
if ("CatalogEntry".equals(codeString))
return ActivityDefinitionKind.CATALOGENTRY;
if ("ChargeItem".equals(codeString))
return ActivityDefinitionKind.CHARGEITEM;
if ("Claim".equals(codeString))
@ -1362,6 +1394,8 @@ public class ActivityDefinition extends MetadataResource {
return ActivityDefinitionKind.EPISODEOFCARE;
if ("EventDefinition".equals(codeString))
return ActivityDefinitionKind.EVENTDEFINITION;
if ("ExampleScenario".equals(codeString))
return ActivityDefinitionKind.EXAMPLESCENARIO;
if ("ExpansionProfile".equals(codeString))
return ActivityDefinitionKind.EXPANSIONPROFILE;
if ("ExplanationOfBenefit".equals(codeString))
@ -1484,6 +1518,8 @@ public class ActivityDefinition extends MetadataResource {
return ActivityDefinitionKind.SLOT;
if ("Specimen".equals(codeString))
return ActivityDefinitionKind.SPECIMEN;
if ("SpecimenDefinition".equals(codeString))
return ActivityDefinitionKind.SPECIMENDEFINITION;
if ("StructureDefinition".equals(codeString))
return ActivityDefinitionKind.STRUCTUREDEFINITION;
if ("StructureMap".equals(codeString))
@ -1544,6 +1580,8 @@ public class ActivityDefinition extends MetadataResource {
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.CAREPLAN);
if ("CareTeam".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.CARETEAM);
if ("CatalogEntry".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.CATALOGENTRY);
if ("ChargeItem".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.CHARGEITEM);
if ("Claim".equals(codeString))
@ -1608,6 +1646,8 @@ public class ActivityDefinition extends MetadataResource {
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.EPISODEOFCARE);
if ("EventDefinition".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.EVENTDEFINITION);
if ("ExampleScenario".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.EXAMPLESCENARIO);
if ("ExpansionProfile".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.EXPANSIONPROFILE);
if ("ExplanationOfBenefit".equals(codeString))
@ -1730,6 +1770,8 @@ public class ActivityDefinition extends MetadataResource {
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.SLOT);
if ("Specimen".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.SPECIMEN);
if ("SpecimenDefinition".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.SPECIMENDEFINITION);
if ("StructureDefinition".equals(codeString))
return new Enumeration<ActivityDefinitionKind>(this, ActivityDefinitionKind.STRUCTUREDEFINITION);
if ("StructureMap".equals(codeString))
@ -1783,6 +1825,8 @@ public class ActivityDefinition extends MetadataResource {
return "CarePlan";
if (code == ActivityDefinitionKind.CARETEAM)
return "CareTeam";
if (code == ActivityDefinitionKind.CATALOGENTRY)
return "CatalogEntry";
if (code == ActivityDefinitionKind.CHARGEITEM)
return "ChargeItem";
if (code == ActivityDefinitionKind.CLAIM)
@ -1847,6 +1891,8 @@ public class ActivityDefinition extends MetadataResource {
return "EpisodeOfCare";
if (code == ActivityDefinitionKind.EVENTDEFINITION)
return "EventDefinition";
if (code == ActivityDefinitionKind.EXAMPLESCENARIO)
return "ExampleScenario";
if (code == ActivityDefinitionKind.EXPANSIONPROFILE)
return "ExpansionProfile";
if (code == ActivityDefinitionKind.EXPLANATIONOFBENEFIT)
@ -1969,6 +2015,8 @@ public class ActivityDefinition extends MetadataResource {
return "Slot";
if (code == ActivityDefinitionKind.SPECIMEN)
return "Specimen";
if (code == ActivityDefinitionKind.SPECIMENDEFINITION)
return "SpecimenDefinition";
if (code == ActivityDefinitionKind.STRUCTUREDEFINITION)
return "StructureDefinition";
if (code == ActivityDefinitionKind.STRUCTUREMAP)

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -1052,7 +1052,7 @@ public class AdverseEvent extends DomainResource {
/**
* This subject or group impacted by the event. With a prospective adverse event, there will be no subject as the adverse event was prevented.
*/
@Child(name = "subject", type = {Patient.class, ResearchSubject.class, Practitioner.class, Person.class}, order=4, min=0, max=1, modifier=false, summary=true)
@Child(name = "subject", type = {Patient.class, ResearchSubject.class, Practitioner.class, RelatedPerson.class}, order=4, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Subject impacted by event", formalDefinition="This subject or group impacted by the event. With a prospective adverse event, there will be no subject as the adverse event was prevented." )
protected Reference subject;
@ -2027,7 +2027,7 @@ public class AdverseEvent extends DomainResource {
children.add(new Property("actuality", "code", "Whether the event actually happened, or just had the potential to. Note that this is independent of whether anyone was affected or harmed or how severely.", 0, 1, actuality));
children.add(new Property("category", "code", "The overall type of event, intended for search and filtering purposes.", 0, 1, category));
children.add(new Property("event", "CodeableConcept", "This element defines the specific type of event that occurred or that was prevented from occurring.", 0, 1, event));
children.add(new Property("subject", "Reference(Patient|ResearchSubject|Practitioner|Person)", "This subject or group impacted by the event. With a prospective adverse event, there will be no subject as the adverse event was prevented.", 0, 1, subject));
children.add(new Property("subject", "Reference(Patient|ResearchSubject|Practitioner|RelatedPerson)", "This subject or group impacted by the event. With a prospective adverse event, there will be no subject as the adverse event was prevented.", 0, 1, subject));
children.add(new Property("date", "dateTime", "The date (and perhaps time) when the adverse event occurred.", 0, 1, date));
children.add(new Property("resultingCondition", "Reference(Condition)", "Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).", 0, java.lang.Integer.MAX_VALUE, resultingCondition));
children.add(new Property("location", "Reference(Location)", "The information about where the adverse event occurred.", 0, 1, location));
@ -2050,7 +2050,7 @@ public class AdverseEvent extends DomainResource {
case 528866400: /*actuality*/ return new Property("actuality", "code", "Whether the event actually happened, or just had the potential to. Note that this is independent of whether anyone was affected or harmed or how severely.", 0, 1, actuality);
case 50511102: /*category*/ return new Property("category", "code", "The overall type of event, intended for search and filtering purposes.", 0, 1, category);
case 96891546: /*event*/ return new Property("event", "CodeableConcept", "This element defines the specific type of event that occurred or that was prevented from occurring.", 0, 1, event);
case -1867885268: /*subject*/ return new Property("subject", "Reference(Patient|ResearchSubject|Practitioner|Person)", "This subject or group impacted by the event. With a prospective adverse event, there will be no subject as the adverse event was prevented.", 0, 1, subject);
case -1867885268: /*subject*/ return new Property("subject", "Reference(Patient|ResearchSubject|Practitioner|RelatedPerson)", "This subject or group impacted by the event. With a prospective adverse event, there will be no subject as the adverse event was prevented.", 0, 1, subject);
case 3076014: /*date*/ return new Property("date", "dateTime", "The date (and perhaps time) when the adverse event occurred.", 0, 1, date);
case -830261258: /*resultingCondition*/ return new Property("resultingCondition", "Reference(Condition)", "Includes information about the reaction that occurred as a result of exposure to a substance (for example, a drug or a chemical).", 0, java.lang.Integer.MAX_VALUE, resultingCondition);
case 1901043637: /*location*/ return new Property("location", "Reference(Location)", "The information about where the adverse event occurred.", 0, 1, location);
@ -2558,7 +2558,7 @@ public class AdverseEvent extends DomainResource {
* Path: <b>AdverseEvent.subject</b><br>
* </p>
*/
@SearchParamDefinition(name="subject", path="AdverseEvent.subject", description="Subject impacted by event", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class, Person.class, Practitioner.class, ResearchSubject.class } )
@SearchParamDefinition(name="subject", path="AdverseEvent.subject", description="Subject impacted by event", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient") }, target={Patient.class, Practitioner.class, RelatedPerson.class, ResearchSubject.class } )
public static final String SP_SUBJECT = "subject";
/**
* <b>Fluent Client</b> search parameter constant for <b>subject</b>

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -195,7 +195,7 @@ public class AuditEvent extends DomainResource {
*/
_0,
/**
* The action was not successful due to some kind of catered for error (often equivalent to an HTTP 400 response).
* The action was not successful due to some kind of minor failure (often equivalent to an HTTP 400 response).
*/
_4,
/**
@ -247,7 +247,7 @@ public class AuditEvent extends DomainResource {
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 _4: return "The action was not successful due to some kind of minor failure (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 no longer available for use (i.e. the system died).";
default: return "?";
@ -455,10 +455,18 @@ public class AuditEvent extends DomainResource {
@Block()
public static class AuditEventAgentComponent extends BackboneElement implements IBaseBackboneElement {
/**
* Specification of the participation type the user plays when performing the event.
*/
@Child(name = "type", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="How agent participated", formalDefinition="Specification of the participation type the user plays when performing the event." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/participation-role-type")
protected CodeableConcept type;
/**
* The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.
*/
@Child(name = "role", type = {CodeableConcept.class}, order=1, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Child(name = "role", type = {CodeableConcept.class}, order=2, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Description(shortDefinition="Agent role in the event", formalDefinition="The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-role-type")
protected List<CodeableConcept> role;
@ -466,7 +474,7 @@ public class AuditEvent extends DomainResource {
/**
* Direct reference to a resource that identifies the agent.
*/
@Child(name = "reference", type = {Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=2, min=0, max=1, modifier=false, summary=true)
@Child(name = "reference", type = {PractitionerRole.class, Practitioner.class, Organization.class, Device.class, Patient.class, RelatedPerson.class}, order=3, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Direct reference to resource", formalDefinition="Direct reference to a resource that identifies the agent." )
protected Reference reference;
@ -478,35 +486,35 @@ public class AuditEvent extends DomainResource {
/**
* Unique identifier for the user actively participating in the event.
*/
@Child(name = "userId", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=true)
@Child(name = "userId", type = {Identifier.class}, order=4, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Unique identifier for the user", formalDefinition="Unique identifier for the user actively participating in the event." )
protected Identifier userId;
/**
* Alternative agent 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, modifier=false, summary=false)
@Child(name = "altId", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Alternative User id e.g. authentication", formalDefinition="Alternative agent 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 agent.
*/
@Child(name = "name", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
@Child(name = "name", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Human-meaningful name for the agent", formalDefinition="Human-meaningful name for the agent." )
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, modifier=false, summary=false)
@Child(name = "requestor", type = {BooleanType.class}, order=7, min=1, max=1, modifier=false, summary=false)
@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;
/**
* Where the event occurred.
*/
@Child(name = "location", type = {Location.class}, order=7, min=0, max=1, modifier=false, summary=false)
@Child(name = "location", type = {Location.class}, order=8, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Where", formalDefinition="Where the event occurred." )
protected Reference location;
@ -518,14 +526,14 @@ public class AuditEvent extends DomainResource {
/**
* The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used.
*/
@Child(name = "policy", type = {UriType.class}, order=8, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Child(name = "policy", type = {UriType.class}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Description(shortDefinition="Policy that authorized event", formalDefinition="The policy or plan that authorized the activity being recorded. Typically, a single activity may have multiple applicable policies, such as patient consent, guarantor funding, etc. The policy would also indicate the security token used." )
protected List<UriType> policy;
/**
* Type of media involved. Used when the event is about exporting/importing onto media.
*/
@Child(name = "media", type = {Coding.class}, order=9, min=0, max=1, modifier=false, summary=false)
@Child(name = "media", type = {Coding.class}, order=10, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Type of media", formalDefinition="Type of media involved. Used when the event is about exporting/importing onto media." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/dicm-405-mediatype")
protected Coding media;
@ -533,19 +541,19 @@ public class AuditEvent extends DomainResource {
/**
* Logical network location for application activity, if the activity has a network location.
*/
@Child(name = "network", type = {}, order=10, min=0, max=1, modifier=false, summary=false)
@Child(name = "network", type = {}, order=11, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Logical network location for application activity", formalDefinition="Logical network location for application activity, if the activity has a network location." )
protected AuditEventAgentNetworkComponent network;
/**
* The reason (purpose of use), specific to this agent, that was used during the event being recorded.
*/
@Child(name = "purposeOfUse", type = {CodeableConcept.class}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Child(name = "purposeOfUse", type = {CodeableConcept.class}, order=12, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Description(shortDefinition="Reason given for this user", formalDefinition="The reason (purpose of use), specific to this agent, that was used during the event being recorded." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse")
protected List<CodeableConcept> purposeOfUse;
private static final long serialVersionUID = 1205071410L;
private static final long serialVersionUID = 1434862021L;
/**
* Constructor
@ -562,6 +570,30 @@ public class AuditEvent extends DomainResource {
this.requestor = requestor;
}
/**
* @return {@link #type} (Specification of the participation type the user plays when performing the event.)
*/
public CodeableConcept getType() {
if (this.type == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create AuditEventAgentComponent.type");
else if (Configuration.doAutoCreate())
this.type = new CodeableConcept(); // cc
return this.type;
}
public boolean hasType() {
return this.type != null && !this.type.isEmpty();
}
/**
* @param value {@link #type} (Specification of the participation type the user plays when performing the event.)
*/
public AuditEventAgentComponent setType(CodeableConcept value) {
this.type = value;
return this;
}
/**
* @return {@link #role} (The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.)
*/
@ -1029,8 +1061,9 @@ public class AuditEvent extends DomainResource {
protected void listChildren(List<Property> children) {
super.listChildren(children);
children.add(new Property("type", "CodeableConcept", "Specification of the participation type the user plays when performing the event.", 0, 1, type));
children.add(new Property("role", "CodeableConcept", "The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.", 0, java.lang.Integer.MAX_VALUE, role));
children.add(new Property("reference", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the agent.", 0, 1, reference));
children.add(new Property("reference", "Reference(PractitionerRole|Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the agent.", 0, 1, reference));
children.add(new Property("userId", "Identifier", "Unique identifier for the user actively participating in the event.", 0, 1, userId));
children.add(new Property("altId", "string", "Alternative agent 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, 1, altId));
children.add(new Property("name", "string", "Human-meaningful name for the agent.", 0, 1, name));
@ -1045,8 +1078,9 @@ public class AuditEvent extends DomainResource {
@Override
public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
switch (_hash) {
case 3575610: /*type*/ return new Property("type", "CodeableConcept", "Specification of the participation type the user plays when performing the event.", 0, 1, type);
case 3506294: /*role*/ return new Property("role", "CodeableConcept", "The security role that the user was acting under, that come from local codes defined by the access control security system (e.g. RBAC, ABAC) used in the local context.", 0, java.lang.Integer.MAX_VALUE, role);
case -925155509: /*reference*/ return new Property("reference", "Reference(Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the agent.", 0, 1, reference);
case -925155509: /*reference*/ return new Property("reference", "Reference(PractitionerRole|Practitioner|Organization|Device|Patient|RelatedPerson)", "Direct reference to a resource that identifies the agent.", 0, 1, reference);
case -836030906: /*userId*/ return new Property("userId", "Identifier", "Unique identifier for the user actively participating in the event.", 0, 1, userId);
case 92912804: /*altId*/ return new Property("altId", "string", "Alternative agent 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, 1, altId);
case 3373707: /*name*/ return new Property("name", "string", "Human-meaningful name for the agent.", 0, 1, name);
@ -1064,6 +1098,7 @@ public class AuditEvent extends DomainResource {
@Override
public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
switch (hash) {
case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
case 3506294: /*role*/ return this.role == null ? new Base[0] : this.role.toArray(new Base[this.role.size()]); // CodeableConcept
case -925155509: /*reference*/ return this.reference == null ? new Base[0] : new Base[] {this.reference}; // Reference
case -836030906: /*userId*/ return this.userId == null ? new Base[0] : new Base[] {this.userId}; // Identifier
@ -1083,6 +1118,9 @@ public class AuditEvent extends DomainResource {
@Override
public Base setProperty(int hash, String name, Base value) throws FHIRException {
switch (hash) {
case 3575610: // type
this.type = castToCodeableConcept(value); // CodeableConcept
return value;
case 3506294: // role
this.getRole().add(castToCodeableConcept(value)); // CodeableConcept
return value;
@ -1123,7 +1161,9 @@ public class AuditEvent extends DomainResource {
@Override
public Base setProperty(String name, Base value) throws FHIRException {
if (name.equals("role")) {
if (name.equals("type")) {
this.type = castToCodeableConcept(value); // CodeableConcept
} else if (name.equals("role")) {
this.getRole().add(castToCodeableConcept(value));
} else if (name.equals("reference")) {
this.reference = castToReference(value); // Reference
@ -1153,6 +1193,7 @@ public class AuditEvent extends DomainResource {
@Override
public Base makeProperty(int hash, String name) throws FHIRException {
switch (hash) {
case 3575610: return getType();
case 3506294: return addRole();
case -925155509: return getReference();
case -836030906: return getUserId();
@ -1172,6 +1213,7 @@ public class AuditEvent extends DomainResource {
@Override
public String[] getTypesForProperty(int hash, String name) throws FHIRException {
switch (hash) {
case 3575610: /*type*/ return new String[] {"CodeableConcept"};
case 3506294: /*role*/ return new String[] {"CodeableConcept"};
case -925155509: /*reference*/ return new String[] {"Reference"};
case -836030906: /*userId*/ return new String[] {"Identifier"};
@ -1190,7 +1232,11 @@ public class AuditEvent extends DomainResource {
@Override
public Base addChild(String name) throws FHIRException {
if (name.equals("role")) {
if (name.equals("type")) {
this.type = new CodeableConcept();
return this.type;
}
else if (name.equals("role")) {
return addRole();
}
else if (name.equals("reference")) {
@ -1235,6 +1281,7 @@ public class AuditEvent extends DomainResource {
public AuditEventAgentComponent copy() {
AuditEventAgentComponent dst = new AuditEventAgentComponent();
copyValues(dst);
dst.type = type == null ? null : type.copy();
if (role != null) {
dst.role = new ArrayList<CodeableConcept>();
for (CodeableConcept i : role)
@ -1268,10 +1315,11 @@ public class AuditEvent extends DomainResource {
if (!(other instanceof AuditEventAgentComponent))
return false;
AuditEventAgentComponent o = (AuditEventAgentComponent) other;
return compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true) && compareDeep(userId, o.userId, true)
&& compareDeep(altId, o.altId, true) && compareDeep(name, o.name, true) && compareDeep(requestor, o.requestor, true)
&& compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true) && compareDeep(media, o.media, true)
&& compareDeep(network, o.network, true) && compareDeep(purposeOfUse, o.purposeOfUse, true);
return compareDeep(type, o.type, true) && compareDeep(role, o.role, true) && compareDeep(reference, o.reference, true)
&& compareDeep(userId, o.userId, true) && compareDeep(altId, o.altId, true) && compareDeep(name, o.name, true)
&& compareDeep(requestor, o.requestor, true) && compareDeep(location, o.location, true) && compareDeep(policy, o.policy, true)
&& compareDeep(media, o.media, true) && compareDeep(network, o.network, true) && compareDeep(purposeOfUse, o.purposeOfUse, true)
;
}
@Override
@ -1286,7 +1334,7 @@ public class AuditEvent extends DomainResource {
}
public boolean isEmpty() {
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(role, reference, userId
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, role, reference, userId
, altId, name, requestor, location, policy, media, network, purposeOfUse);
}
@ -2594,13 +2642,13 @@ public class AuditEvent extends DomainResource {
protected StringType type;
/**
* The details, base64 encoded. Used to carry bulk information.
* The details value.
*/
@Child(name = "value", type = {Base64BinaryType.class}, order=2, min=1, max=1, modifier=false, summary=false)
@Description(shortDefinition="Property value", formalDefinition="The details, base64 encoded. Used to carry bulk information." )
protected Base64BinaryType value;
@Child(name = "value", type = {StringType.class, Base64BinaryType.class}, order=2, min=1, max=1, modifier=false, summary=false)
@Description(shortDefinition="Property value", formalDefinition="The details value." )
protected Type value;
private static final long serialVersionUID = 11139504L;
private static final long serialVersionUID = -1035059584L;
/**
* Constructor
@ -2612,7 +2660,7 @@ public class AuditEvent extends DomainResource {
/**
* Constructor
*/
public AuditEventEntityDetailComponent(StringType type, Base64BinaryType value) {
public AuditEventEntityDetailComponent(StringType type, Type value) {
super();
this.type = type;
this.value = value;
@ -2664,19 +2712,36 @@ public class AuditEvent extends DomainResource {
}
/**
* @return {@link #value} (The details, base64 encoded. Used to carry bulk information.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
* @return {@link #value} (The details value.)
*/
public Base64BinaryType getValueElement() {
if (this.value == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create AuditEventEntityDetailComponent.value");
else if (Configuration.doAutoCreate())
this.value = new Base64BinaryType(); // bb
public Type getValue() {
return this.value;
}
public boolean hasValueElement() {
return this.value != null && !this.value.isEmpty();
/**
* @return {@link #value} (The details value.)
*/
public StringType getValueStringType() throws FHIRException {
if (!(this.value instanceof StringType))
throw new FHIRException("Type mismatch: the type StringType was expected, but "+this.value.getClass().getName()+" was encountered");
return (StringType) this.value;
}
public boolean hasValueStringType() {
return this.value instanceof StringType;
}
/**
* @return {@link #value} (The details value.)
*/
public Base64BinaryType getValueBase64BinaryType() throws FHIRException {
if (!(this.value instanceof Base64BinaryType))
throw new FHIRException("Type mismatch: the type Base64BinaryType was expected, but "+this.value.getClass().getName()+" was encountered");
return (Base64BinaryType) this.value;
}
public boolean hasValueBase64BinaryType() {
return this.value instanceof Base64BinaryType;
}
public boolean hasValue() {
@ -2684,41 +2749,27 @@ public class AuditEvent extends DomainResource {
}
/**
* @param value {@link #value} (The details, base64 encoded. Used to carry bulk information.). This is the underlying object with id, value and extensions. The accessor "getValue" gives direct access to the value
* @param value {@link #value} (The details value.)
*/
public AuditEventEntityDetailComponent setValueElement(Base64BinaryType value) {
public AuditEventEntityDetailComponent setValue(Type value) {
this.value = value;
return this;
}
/**
* @return The details, base64 encoded. Used to carry bulk information.
*/
public byte[] getValue() {
return this.value == null ? null : this.value.getValue();
}
/**
* @param value The details, base64 encoded. Used to carry bulk information.
*/
public AuditEventEntityDetailComponent setValue(byte[] value) {
if (this.value == null)
this.value = new Base64BinaryType();
this.value.setValue(value);
return this;
}
protected void listChildren(List<Property> children) {
super.listChildren(children);
children.add(new Property("type", "string", "The type of extra detail provided in the value.", 0, 1, type));
children.add(new Property("value", "base64Binary", "The details, base64 encoded. Used to carry bulk information.", 0, 1, value));
children.add(new Property("value[x]", "string|base64Binary", "The details value.", 0, 1, value));
}
@Override
public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
switch (_hash) {
case 3575610: /*type*/ return new Property("type", "string", "The type of extra detail provided in the value.", 0, 1, type);
case 111972721: /*value*/ return new Property("value", "base64Binary", "The details, base64 encoded. Used to carry bulk information.", 0, 1, value);
case -1410166417: /*value[x]*/ return new Property("value[x]", "string|base64Binary", "The details value.", 0, 1, value);
case 111972721: /*value*/ return new Property("value[x]", "string|base64Binary", "The details value.", 0, 1, value);
case -1424603934: /*valueString*/ return new Property("value[x]", "string|base64Binary", "The details value.", 0, 1, value);
case -1535024575: /*valueBase64Binary*/ return new Property("value[x]", "string|base64Binary", "The details value.", 0, 1, value);
default: return super.getNamedProperty(_hash, _name, _checkValid);
}
@ -2728,7 +2779,7 @@ public class AuditEvent extends DomainResource {
public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
switch (hash) {
case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // StringType
case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Base64BinaryType
case 111972721: /*value*/ return this.value == null ? new Base[0] : new Base[] {this.value}; // Type
default: return super.getProperty(hash, name, checkValid);
}
@ -2741,7 +2792,7 @@ public class AuditEvent extends DomainResource {
this.type = castToString(value); // StringType
return value;
case 111972721: // value
this.value = castToBase64Binary(value); // Base64BinaryType
this.value = castToType(value); // Type
return value;
default: return super.setProperty(hash, name, value);
}
@ -2752,8 +2803,8 @@ public class AuditEvent extends DomainResource {
public Base setProperty(String name, Base value) throws FHIRException {
if (name.equals("type")) {
this.type = castToString(value); // StringType
} else if (name.equals("value")) {
this.value = castToBase64Binary(value); // Base64BinaryType
} else if (name.equals("value[x]")) {
this.value = castToType(value); // Type
} else
return super.setProperty(name, value);
return value;
@ -2763,7 +2814,8 @@ public class AuditEvent extends DomainResource {
public Base makeProperty(int hash, String name) throws FHIRException {
switch (hash) {
case 3575610: return getTypeElement();
case 111972721: return getValueElement();
case -1410166417: return getValue();
case 111972721: return getValue();
default: return super.makeProperty(hash, name);
}
@ -2773,7 +2825,7 @@ public class AuditEvent extends DomainResource {
public String[] getTypesForProperty(int hash, String name) throws FHIRException {
switch (hash) {
case 3575610: /*type*/ return new String[] {"string"};
case 111972721: /*value*/ return new String[] {"base64Binary"};
case 111972721: /*value*/ return new String[] {"string", "base64Binary"};
default: return super.getTypesForProperty(hash, name);
}
@ -2784,8 +2836,13 @@ public class AuditEvent extends DomainResource {
if (name.equals("type")) {
throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.type");
}
else if (name.equals("value")) {
throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.value");
else if (name.equals("valueString")) {
this.value = new StringType();
return this.value;
}
else if (name.equals("valueBase64Binary")) {
this.value = new Base64BinaryType();
return this.value;
}
else
return super.addChild(name);
@ -2816,7 +2873,7 @@ public class AuditEvent extends DomainResource {
if (!(other instanceof AuditEventEntityDetailComponent))
return false;
AuditEventEntityDetailComponent o = (AuditEventEntityDetailComponent) other;
return compareValues(type, o.type, true) && compareValues(value, o.value, true);
return compareValues(type, o.type, true);
}
public boolean isEmpty() {
@ -2854,17 +2911,24 @@ public class AuditEvent extends DomainResource {
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/audit-event-action")
protected Enumeration<AuditEventAction> action;
/**
* The period during which the activity occurred.
*/
@Child(name = "period", type = {Period.class}, order=3, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="When the activity occurred", formalDefinition="The period during which the activity occurred." )
protected Period period;
/**
* The time when the event occurred on the source.
*/
@Child(name = "recorded", type = {InstantType.class}, order=3, min=1, max=1, modifier=false, summary=true)
@Child(name = "recorded", type = {InstantType.class}, order=4, min=1, max=1, modifier=false, summary=true)
@Description(shortDefinition="Time when the event occurred on source", formalDefinition="The time when the event occurred on the source." )
protected InstantType recorded;
/**
* Indicates whether the event succeeded or failed.
*/
@Child(name = "outcome", type = {CodeType.class}, order=4, min=0, max=1, modifier=false, summary=true)
@Child(name = "outcome", type = {CodeType.class}, order=5, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Whether the event succeeded or failed", formalDefinition="Indicates whether the event succeeded or failed." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/audit-event-outcome")
protected Enumeration<AuditEventOutcome> outcome;
@ -2872,14 +2936,14 @@ public class AuditEvent extends DomainResource {
/**
* A free text description of the outcome of the event.
*/
@Child(name = "outcomeDesc", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=true)
@Child(name = "outcomeDesc", type = {StringType.class}, order=6, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Description of the event outcome", formalDefinition="A free text description of the outcome of the event." )
protected StringType outcomeDesc;
/**
* The purposeOfUse (reason) that was used during the event being recorded.
*/
@Child(name = "purposeOfEvent", type = {CodeableConcept.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
@Child(name = "purposeOfEvent", type = {CodeableConcept.class}, order=7, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
@Description(shortDefinition="The purposeOfUse of the event", formalDefinition="The purposeOfUse (reason) that was used during the event being recorded." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-PurposeOfUse")
protected List<CodeableConcept> purposeOfEvent;
@ -2887,25 +2951,25 @@ public class AuditEvent extends DomainResource {
/**
* An actor taking an active role in the event or activity that is logged.
*/
@Child(name = "agent", type = {}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Child(name = "agent", type = {}, order=8, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Description(shortDefinition="Actor involved in the event", formalDefinition="An actor taking an active role in the event or activity that is logged." )
protected List<AuditEventAgentComponent> agent;
/**
* The system that is reporting the event.
*/
@Child(name = "source", type = {}, order=8, min=1, max=1, modifier=false, summary=false)
@Child(name = "source", type = {}, order=9, min=1, max=1, modifier=false, summary=false)
@Description(shortDefinition="Audit Event Reporter", formalDefinition="The system that is reporting the event." )
protected AuditEventSourceComponent source;
/**
* Specific instances of data or objects that have been accessed.
*/
@Child(name = "entity", type = {}, order=9, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Child(name = "entity", type = {}, order=10, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Description(shortDefinition="Data or objects used", formalDefinition="Specific instances of data or objects that have been accessed." )
protected List<AuditEventEntityComponent> entity;
private static final long serialVersionUID = 2102955199L;
private static final long serialVersionUID = 106433685L;
/**
* Constructor
@ -3050,6 +3114,30 @@ public class AuditEvent extends DomainResource {
return this;
}
/**
* @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 AuditEvent.period");
else if (Configuration.doAutoCreate())
this.period = new Period(); // cc
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 AuditEvent setPeriod(Period value) {
this.period = value;
return this;
}
/**
* @return {@link #recorded} (The time when the event occurred on the source.). This is the underlying object with id, value and extensions. The accessor "getRecorded" gives direct access to the value
*/
@ -3381,6 +3469,7 @@ public class AuditEvent extends DomainResource {
children.add(new Property("type", "Coding", "Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.", 0, 1, type));
children.add(new Property("subtype", "Coding", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype));
children.add(new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, 1, action));
children.add(new Property("period", "Period", "The period during which the activity occurred.", 0, 1, period));
children.add(new Property("recorded", "instant", "The time when the event occurred on the source.", 0, 1, recorded));
children.add(new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, 1, outcome));
children.add(new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, 1, outcomeDesc));
@ -3396,6 +3485,7 @@ public class AuditEvent extends DomainResource {
case 3575610: /*type*/ return new Property("type", "Coding", "Identifier for a family of the event. For example, a menu item, program, rule, policy, function code, application name or URL. It identifies the performed function.", 0, 1, type);
case -1867567750: /*subtype*/ return new Property("subtype", "Coding", "Identifier for the category of event.", 0, java.lang.Integer.MAX_VALUE, subtype);
case -1422950858: /*action*/ return new Property("action", "code", "Indicator for type of action performed during the event that generated the audit.", 0, 1, action);
case -991726143: /*period*/ return new Property("period", "Period", "The period during which the activity occurred.", 0, 1, period);
case -799233872: /*recorded*/ return new Property("recorded", "instant", "The time when the event occurred on the source.", 0, 1, recorded);
case -1106507950: /*outcome*/ return new Property("outcome", "code", "Indicates whether the event succeeded or failed.", 0, 1, outcome);
case 1062502659: /*outcomeDesc*/ return new Property("outcomeDesc", "string", "A free text description of the outcome of the event.", 0, 1, outcomeDesc);
@ -3414,6 +3504,7 @@ public class AuditEvent extends DomainResource {
case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Coding
case -1867567750: /*subtype*/ return this.subtype == null ? new Base[0] : this.subtype.toArray(new Base[this.subtype.size()]); // Coding
case -1422950858: /*action*/ return this.action == null ? new Base[0] : new Base[] {this.action}; // Enumeration<AuditEventAction>
case -991726143: /*period*/ return this.period == null ? new Base[0] : new Base[] {this.period}; // Period
case -799233872: /*recorded*/ return this.recorded == null ? new Base[0] : new Base[] {this.recorded}; // InstantType
case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<AuditEventOutcome>
case 1062502659: /*outcomeDesc*/ return this.outcomeDesc == null ? new Base[0] : new Base[] {this.outcomeDesc}; // StringType
@ -3439,6 +3530,9 @@ public class AuditEvent extends DomainResource {
value = new AuditEventActionEnumFactory().fromType(castToCode(value));
this.action = (Enumeration) value; // Enumeration<AuditEventAction>
return value;
case -991726143: // period
this.period = castToPeriod(value); // Period
return value;
case -799233872: // recorded
this.recorded = castToInstant(value); // InstantType
return value;
@ -3475,6 +3569,8 @@ public class AuditEvent extends DomainResource {
} else if (name.equals("action")) {
value = new AuditEventActionEnumFactory().fromType(castToCode(value));
this.action = (Enumeration) value; // Enumeration<AuditEventAction>
} else if (name.equals("period")) {
this.period = castToPeriod(value); // Period
} else if (name.equals("recorded")) {
this.recorded = castToInstant(value); // InstantType
} else if (name.equals("outcome")) {
@ -3501,6 +3597,7 @@ public class AuditEvent extends DomainResource {
case 3575610: return getType();
case -1867567750: return addSubtype();
case -1422950858: return getActionElement();
case -991726143: return getPeriod();
case -799233872: return getRecordedElement();
case -1106507950: return getOutcomeElement();
case 1062502659: return getOutcomeDescElement();
@ -3519,6 +3616,7 @@ public class AuditEvent extends DomainResource {
case 3575610: /*type*/ return new String[] {"Coding"};
case -1867567750: /*subtype*/ return new String[] {"Coding"};
case -1422950858: /*action*/ return new String[] {"code"};
case -991726143: /*period*/ return new String[] {"Period"};
case -799233872: /*recorded*/ return new String[] {"instant"};
case -1106507950: /*outcome*/ return new String[] {"code"};
case 1062502659: /*outcomeDesc*/ return new String[] {"string"};
@ -3543,6 +3641,10 @@ public class AuditEvent extends DomainResource {
else if (name.equals("action")) {
throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.action");
}
else if (name.equals("period")) {
this.period = new Period();
return this.period;
}
else if (name.equals("recorded")) {
throw new FHIRException("Cannot call addChild on a primitive type AuditEvent.recorded");
}
@ -3584,6 +3686,7 @@ public class AuditEvent extends DomainResource {
dst.subtype.add(i.copy());
};
dst.action = action == null ? null : action.copy();
dst.period = period == null ? null : period.copy();
dst.recorded = recorded == null ? null : recorded.copy();
dst.outcome = outcome == null ? null : outcome.copy();
dst.outcomeDesc = outcomeDesc == null ? null : outcomeDesc.copy();
@ -3618,9 +3721,10 @@ public class AuditEvent extends DomainResource {
return false;
AuditEvent o = (AuditEvent) other;
return compareDeep(type, o.type, true) && compareDeep(subtype, o.subtype, true) && compareDeep(action, o.action, true)
&& compareDeep(recorded, o.recorded, true) && compareDeep(outcome, o.outcome, true) && compareDeep(outcomeDesc, o.outcomeDesc, true)
&& compareDeep(purposeOfEvent, o.purposeOfEvent, true) && compareDeep(agent, o.agent, true) && compareDeep(source, o.source, true)
&& compareDeep(entity, o.entity, true);
&& compareDeep(period, o.period, true) && compareDeep(recorded, o.recorded, true) && compareDeep(outcome, o.outcome, true)
&& compareDeep(outcomeDesc, o.outcomeDesc, true) && compareDeep(purposeOfEvent, o.purposeOfEvent, true)
&& compareDeep(agent, o.agent, true) && compareDeep(source, o.source, true) && compareDeep(entity, o.entity, true)
;
}
@Override
@ -3635,8 +3739,8 @@ public class AuditEvent extends DomainResource {
}
public boolean isEmpty() {
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, subtype, action, recorded
, outcome, outcomeDesc, purposeOfEvent, agent, source, entity);
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(type, subtype, action, period
, recorded, outcome, outcomeDesc, purposeOfEvent, agent, source, entity);
}
@Override
@ -3692,7 +3796,7 @@ public class AuditEvent extends DomainResource {
* Path: <b>AuditEvent.agent.reference</b><br>
* </p>
*/
@SearchParamDefinition(name="agent", path="AuditEvent.agent.reference", description="Direct reference to resource", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, RelatedPerson.class } )
@SearchParamDefinition(name="agent", path="AuditEvent.agent.reference", description="Direct reference to resource", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Device.class, Organization.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
public static final String SP_AGENT = "agent";
/**
* <b>Fluent Client</b> search parameter constant for <b>agent</b>

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -2,14 +2,17 @@ package org.hl7.fhir.r4.model;
import static org.apache.commons.lang3.StringUtils.isBlank;
import java.util.*;
import java.util.Calendar;
import java.util.Date;
import java.util.GregorianCalendar;
import java.util.TimeZone;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import org.apache.commons.lang3.StringUtils;
import org.apache.commons.lang3.Validate;
import org.apache.commons.lang3.time.DateUtils;
import org.apache.commons.lang3.time.FastDateFormat;
import ca.uhn.fhir.model.api.TemporalPrecisionEnum;
import ca.uhn.fhir.parser.DataFormatException;
public abstract class BaseDateTimeType extends PrimitiveType<Date> {
@ -205,6 +208,14 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return getFieldValue(Calendar.DAY_OF_MONTH);
}
/**
* Sets the month with 1-index, e.g. 1=the first day of the month
*/
public BaseDateTimeType setDay(int theDay) {
setFieldValue(Calendar.DAY_OF_MONTH, theDay, null, 0, 31);
return this;
}
/**
* Returns the default precision for the given datatype
*/
@ -225,6 +236,14 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return getFieldValue(Calendar.HOUR_OF_DAY);
}
/**
* Sets the hour of the day in a 24h clock, e.g. 13=1pm
*/
public BaseDateTimeType setHour(int theHour) {
setFieldValue(Calendar.HOUR_OF_DAY, theHour, null, 0, 23);
return this;
}
/**
* Returns the milliseconds within the current second.
* <p>
@ -236,6 +255,18 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return getFieldValue(Calendar.MILLISECOND);
}
/**
* Sets the milliseconds within the current second.
* <p>
* Note that this method sets the
* same value as {@link #setNanos(long)} but with less precision.
* </p>
*/
public BaseDateTimeType setMillis(int theMillis) {
setFieldValue(Calendar.MILLISECOND, theMillis, null, 0, 999);
return this;
}
/**
* Returns the minute of the hour in the range 0-59
*/
@ -243,6 +274,14 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return getFieldValue(Calendar.MINUTE);
}
/**
* Sets the minute of the hour in the range 0-59
*/
public BaseDateTimeType setMinute(int theMinute) {
setFieldValue(Calendar.MINUTE, theMinute, null, 0, 59);
return this;
}
/**
* Returns the month with 0-index, e.g. 0=January
*/
@ -250,6 +289,14 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return getFieldValue(Calendar.MONTH);
}
/**
* Sets the month with 0-index, e.g. 0=January
*/
public BaseDateTimeType setMonth(int theMonth) {
setFieldValue(Calendar.MONTH, theMonth, null, 0, 11);
return this;
}
/**
* Returns the nanoseconds within the current second
* <p>
@ -266,6 +313,29 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return Long.parseLong(retVal);
}
/**
* Sets the nanoseconds within the current second
* <p>
* Note that this method sets the
* same value as {@link #setMillis(int)} but with more precision.
* </p>
*/
public BaseDateTimeType setNanos(long theNanos) {
validateValueInRange(theNanos, 0, NANOS_PER_SECOND - 1);
String fractionalSeconds = StringUtils.leftPad(Long.toString(theNanos), 9, '0');
// Strip trailing 0s
for (int i = fractionalSeconds.length(); i > 0; i--) {
if (fractionalSeconds.charAt(i - 1) != '0') {
fractionalSeconds = fractionalSeconds.substring(0, i);
break;
}
}
int millis = (int) (theNanos / NANOS_PER_MILLIS);
setFieldValue(Calendar.MILLISECOND, millis, fractionalSeconds, 0, 999);
return this;
}
private int getOffsetIndex(String theValueString) {
int plusIndex = theValueString.indexOf('+', 16);
int minusIndex = theValueString.indexOf('-', 16);
@ -282,7 +352,7 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
/**
* Gets the precision for this datatype (using the default for the given type if not set)
*
*
* @see #setPrecision(TemporalPrecisionEnum)
*/
public TemporalPrecisionEnum getPrecision() {
@ -292,6 +362,19 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return myPrecision;
}
/**
* Sets the precision for this datatype
*
* @throws DataFormatException
*/
public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException {
if (thePrecision == null) {
throw new NullPointerException("Precision may not be null");
}
myPrecision = thePrecision;
updateStringValue();
}
/**
* Returns the second of the minute in the range 0-59
*/
@ -299,6 +382,14 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return getFieldValue(Calendar.SECOND);
}
/**
* Sets the second of the minute in the range 0-59
*/
public BaseDateTimeType setSecond(int theSecond) {
setFieldValue(Calendar.SECOND, theSecond, null, 0, 59);
return this;
}
/**
* Returns the TimeZone associated with this dateTime's value. May return <code>null</code> if no timezone was
* supplied.
@ -310,6 +401,13 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return myTimeZone;
}
public BaseDateTimeType setTimeZone(TimeZone theTimeZone) {
myTimeZone = theTimeZone;
myTimeZoneZulu = false;
updateStringValue();
return this;
}
/**
* Returns the value of this object as a {@link GregorianCalendar}
*/
@ -334,6 +432,14 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return getFieldValue(Calendar.YEAR);
}
/**
* Sets the year, e.g. 2015
*/
public BaseDateTimeType setYear(int theYear) {
setFieldValue(Calendar.YEAR, theYear, null, 0, 9999);
return this;
}
/**
* To be implemented by subclasses to indicate whether the given precision is allowed by this type
*/
@ -346,9 +452,16 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return myTimeZoneZulu;
}
public BaseDateTimeType setTimeZoneZulu(boolean theTimeZoneZulu) {
myTimeZoneZulu = theTimeZoneZulu;
myTimeZone = null;
updateStringValue();
return this;
}
/**
* Returns <code>true</code> if this object represents a date that is today's date
*
*
* @throws NullPointerException
* if {@link #getValue()} returns <code>null</code>
*/
@ -489,14 +602,6 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return retVal;
}
/**
* Sets the month with 1-index, e.g. 1=the first day of the month
*/
public BaseDateTimeType setDay(int theDay) {
setFieldValue(Calendar.DAY_OF_MONTH, theDay, null, 0, 31);
return this;
}
private void setFieldValue(int theField, int theValue, String theFractionalSeconds, int theMinimum, int theMaximum) {
validateValueInRange(theValue, theMinimum, theMaximum);
Calendar cal;
@ -516,86 +621,6 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
super.setValue(cal.getTime());
}
/**
* Sets the hour of the day in a 24h clock, e.g. 13=1pm
*/
public BaseDateTimeType setHour(int theHour) {
setFieldValue(Calendar.HOUR_OF_DAY, theHour, null, 0, 23);
return this;
}
/**
* Sets the milliseconds within the current second.
* <p>
* Note that this method sets the
* same value as {@link #setNanos(long)} but with less precision.
* </p>
*/
public BaseDateTimeType setMillis(int theMillis) {
setFieldValue(Calendar.MILLISECOND, theMillis, null, 0, 999);
return this;
}
/**
* Sets the minute of the hour in the range 0-59
*/
public BaseDateTimeType setMinute(int theMinute) {
setFieldValue(Calendar.MINUTE, theMinute, null, 0, 59);
return this;
}
/**
* Sets the month with 0-index, e.g. 0=January
*/
public BaseDateTimeType setMonth(int theMonth) {
setFieldValue(Calendar.MONTH, theMonth, null, 0, 11);
return this;
}
/**
* Sets the nanoseconds within the current second
* <p>
* Note that this method sets the
* same value as {@link #setMillis(int)} but with more precision.
* </p>
*/
public BaseDateTimeType setNanos(long theNanos) {
validateValueInRange(theNanos, 0, NANOS_PER_SECOND - 1);
String fractionalSeconds = StringUtils.leftPad(Long.toString(theNanos), 9, '0');
// Strip trailing 0s
for (int i = fractionalSeconds.length(); i > 0; i--) {
if (fractionalSeconds.charAt(i - 1) != '0') {
fractionalSeconds = fractionalSeconds.substring(0, i);
break;
}
}
int millis = (int) (theNanos / NANOS_PER_MILLIS);
setFieldValue(Calendar.MILLISECOND, millis, fractionalSeconds, 0, 999);
return this;
}
/**
* Sets the precision for this datatype
*
* @throws DataFormatException
*/
public void setPrecision(TemporalPrecisionEnum thePrecision) throws DataFormatException {
if (thePrecision == null) {
throw new NullPointerException("Precision may not be null");
}
myPrecision = thePrecision;
updateStringValue();
}
/**
* Sets the second of the minute in the range 0-59
*/
public BaseDateTimeType setSecond(int theSecond) {
setFieldValue(Calendar.SECOND, theSecond, null, 0, 59);
return this;
}
private BaseDateTimeType setTimeZone(String theWholeValue, String theValue) {
if (isBlank(theValue)) {
@ -617,20 +642,6 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
return this;
}
public BaseDateTimeType setTimeZone(TimeZone theTimeZone) {
myTimeZone = theTimeZone;
myTimeZoneZulu = false;
updateStringValue();
return this;
}
public BaseDateTimeType setTimeZoneZulu(boolean theTimeZoneZulu) {
myTimeZoneZulu = theTimeZoneZulu;
myTimeZone = null;
updateStringValue();
return this;
}
/**
* Sets the value for this type using the given Java Date object as the time, and using the default precision for
* this datatype (unless the precision is already set), as well as the local timezone as determined by the local operating
@ -646,7 +657,7 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
* Sets the value for this type using the given Java Date object as the time, and using the specified precision, as
* well as the local timezone as determined by the local operating system. Both of
* these properties may be modified in subsequent calls if neccesary.
*
*
* @param theValue
* The date value
* @param thePrecision
@ -718,14 +729,6 @@ public abstract class BaseDateTimeType extends PrimitiveType<Date> {
}
}
/**
* Sets the year, e.g. 2015
*/
public BaseDateTimeType setYear(int theYear) {
setFieldValue(Calendar.YEAR, theYear, null, 0, 9999);
return this;
}
private void throwBadDateFormat(String theValue) {
throw new DataFormatException("Invalid date/time format: \"" + theValue + "\"");
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -346,6 +346,194 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
}
}
public enum CarePlanActivityKind {
/**
* null
*/
APPOINTMENT,
/**
* null
*/
COMMUNICATIONREQUEST,
/**
* null
*/
DEVICEREQUEST,
/**
* null
*/
MEDICATIONREQUEST,
/**
* null
*/
NUTRITIONORDER,
/**
* null
*/
TASK,
/**
* null
*/
PROCEDUREREQUEST,
/**
* null
*/
VISIONPRESCRIPTION,
/**
* added to help the parsers with the generic types
*/
NULL;
public static CarePlanActivityKind fromCode(String codeString) throws FHIRException {
if (codeString == null || "".equals(codeString))
return null;
if ("Appointment".equals(codeString))
return APPOINTMENT;
if ("CommunicationRequest".equals(codeString))
return COMMUNICATIONREQUEST;
if ("DeviceRequest".equals(codeString))
return DEVICEREQUEST;
if ("MedicationRequest".equals(codeString))
return MEDICATIONREQUEST;
if ("NutritionOrder".equals(codeString))
return NUTRITIONORDER;
if ("Task".equals(codeString))
return TASK;
if ("ProcedureRequest".equals(codeString))
return PROCEDUREREQUEST;
if ("VisionPrescription".equals(codeString))
return VISIONPRESCRIPTION;
if (Configuration.isAcceptInvalidEnums())
return null;
else
throw new FHIRException("Unknown CarePlanActivityKind code '"+codeString+"'");
}
public String toCode() {
switch (this) {
case APPOINTMENT: return "Appointment";
case COMMUNICATIONREQUEST: return "CommunicationRequest";
case DEVICEREQUEST: return "DeviceRequest";
case MEDICATIONREQUEST: return "MedicationRequest";
case NUTRITIONORDER: return "NutritionOrder";
case TASK: return "Task";
case PROCEDUREREQUEST: return "ProcedureRequest";
case VISIONPRESCRIPTION: return "VisionPrescription";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case APPOINTMENT: return "http://hl7.org/fhir/resource-types";
case COMMUNICATIONREQUEST: return "http://hl7.org/fhir/resource-types";
case DEVICEREQUEST: return "http://hl7.org/fhir/resource-types";
case MEDICATIONREQUEST: return "http://hl7.org/fhir/resource-types";
case NUTRITIONORDER: return "http://hl7.org/fhir/resource-types";
case TASK: return "http://hl7.org/fhir/resource-types";
case PROCEDUREREQUEST: return "http://hl7.org/fhir/resource-types";
case VISIONPRESCRIPTION: return "http://hl7.org/fhir/resource-types";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case APPOINTMENT: return "";
case COMMUNICATIONREQUEST: return "";
case DEVICEREQUEST: return "";
case MEDICATIONREQUEST: return "";
case NUTRITIONORDER: return "";
case TASK: return "";
case PROCEDUREREQUEST: return "";
case VISIONPRESCRIPTION: return "";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case APPOINTMENT: return "Appointment";
case COMMUNICATIONREQUEST: return "CommunicationRequest";
case DEVICEREQUEST: return "DeviceRequest";
case MEDICATIONREQUEST: return "MedicationRequest";
case NUTRITIONORDER: return "NutritionOrder";
case TASK: return "Task";
case PROCEDUREREQUEST: return "ProcedureRequest";
case VISIONPRESCRIPTION: return "VisionPrescription";
default: return "?";
}
}
}
public static class CarePlanActivityKindEnumFactory implements EnumFactory<CarePlanActivityKind> {
public CarePlanActivityKind fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("Appointment".equals(codeString))
return CarePlanActivityKind.APPOINTMENT;
if ("CommunicationRequest".equals(codeString))
return CarePlanActivityKind.COMMUNICATIONREQUEST;
if ("DeviceRequest".equals(codeString))
return CarePlanActivityKind.DEVICEREQUEST;
if ("MedicationRequest".equals(codeString))
return CarePlanActivityKind.MEDICATIONREQUEST;
if ("NutritionOrder".equals(codeString))
return CarePlanActivityKind.NUTRITIONORDER;
if ("Task".equals(codeString))
return CarePlanActivityKind.TASK;
if ("ProcedureRequest".equals(codeString))
return CarePlanActivityKind.PROCEDUREREQUEST;
if ("VisionPrescription".equals(codeString))
return CarePlanActivityKind.VISIONPRESCRIPTION;
throw new IllegalArgumentException("Unknown CarePlanActivityKind code '"+codeString+"'");
}
public Enumeration<CarePlanActivityKind> fromType(Base code) throws FHIRException {
if (code == null)
return null;
if (code.isEmpty())
return new Enumeration<CarePlanActivityKind>(this);
String codeString = ((PrimitiveType) code).asStringValue();
if (codeString == null || "".equals(codeString))
return null;
if ("Appointment".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.APPOINTMENT);
if ("CommunicationRequest".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.COMMUNICATIONREQUEST);
if ("DeviceRequest".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.DEVICEREQUEST);
if ("MedicationRequest".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.MEDICATIONREQUEST);
if ("NutritionOrder".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.NUTRITIONORDER);
if ("Task".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.TASK);
if ("ProcedureRequest".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.PROCEDUREREQUEST);
if ("VisionPrescription".equals(codeString))
return new Enumeration<CarePlanActivityKind>(this, CarePlanActivityKind.VISIONPRESCRIPTION);
throw new FHIRException("Unknown CarePlanActivityKind code '"+codeString+"'");
}
public String toCode(CarePlanActivityKind code) {
if (code == CarePlanActivityKind.APPOINTMENT)
return "Appointment";
if (code == CarePlanActivityKind.COMMUNICATIONREQUEST)
return "CommunicationRequest";
if (code == CarePlanActivityKind.DEVICEREQUEST)
return "DeviceRequest";
if (code == CarePlanActivityKind.MEDICATIONREQUEST)
return "MedicationRequest";
if (code == CarePlanActivityKind.NUTRITIONORDER)
return "NutritionOrder";
if (code == CarePlanActivityKind.TASK)
return "Task";
if (code == CarePlanActivityKind.PROCEDUREREQUEST)
return "ProcedureRequest";
if (code == CarePlanActivityKind.VISIONPRESCRIPTION)
return "VisionPrescription";
return "?";
}
public String toSystem(CarePlanActivityKind code) {
return code.getSystem();
}
}
public enum CarePlanActivityStatus {
/**
* Activity is planned but no action has yet been taken.
@ -1007,12 +1195,12 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Block()
public static class CarePlanActivityDetailComponent extends BackboneElement implements IBaseBackboneElement {
/**
* High-level categorization of the type of activity in a care plan.
* A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest.
*/
@Child(name = "category", type = {CodeableConcept.class}, order=1, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="diet | drug | encounter | observation | procedure | supply | other", formalDefinition="High-level categorization of the type of activity in a care plan." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-activity-category")
protected CodeableConcept category;
@Child(name = "kind", type = {CodeType.class}, order=1, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Kind of resource", formalDefinition="A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/care-plan-activity-kind")
protected Enumeration<CarePlanActivityKind> kind;
/**
* Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.
@ -1148,7 +1336,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Description(shortDefinition="Extra info describing activity to perform", formalDefinition="This provides a textual description of constraints on the intended 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 description;
private static final long serialVersionUID = -549984462L;
private static final long serialVersionUID = 677010887L;
/**
* Constructor
@ -1166,26 +1354,51 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
}
/**
* @return {@link #category} (High-level categorization of the type of activity in a care plan.)
* @return {@link #kind} (A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
*/
public CodeableConcept getCategory() {
if (this.category == null)
public Enumeration<CarePlanActivityKind> getKindElement() {
if (this.kind == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.category");
throw new Error("Attempt to auto-create CarePlanActivityDetailComponent.kind");
else if (Configuration.doAutoCreate())
this.category = new CodeableConcept(); // cc
return this.category;
this.kind = new Enumeration<CarePlanActivityKind>(new CarePlanActivityKindEnumFactory()); // bb
return this.kind;
}
public boolean hasCategory() {
return this.category != null && !this.category.isEmpty();
public boolean hasKindElement() {
return this.kind != null && !this.kind.isEmpty();
}
public boolean hasKind() {
return this.kind != null && !this.kind.isEmpty();
}
/**
* @param value {@link #category} (High-level categorization of the type of activity in a care plan.)
* @param value {@link #kind} (A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest.). This is the underlying object with id, value and extensions. The accessor "getKind" gives direct access to the value
*/
public CarePlanActivityDetailComponent setCategory(CodeableConcept value) {
this.category = value;
public CarePlanActivityDetailComponent setKindElement(Enumeration<CarePlanActivityKind> value) {
this.kind = value;
return this;
}
/**
* @return A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest.
*/
public CarePlanActivityKind getKind() {
return this.kind == null ? null : this.kind.getValue();
}
/**
* @param value A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest.
*/
public CarePlanActivityDetailComponent setKind(CarePlanActivityKind value) {
if (value == null)
this.kind = null;
else {
if (this.kind == null)
this.kind = new Enumeration<CarePlanActivityKind>(new CarePlanActivityKindEnumFactory());
this.kind.setValue(value);
}
return this;
}
@ -1903,7 +2116,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
protected void listChildren(List<Property> children) {
super.listChildren(children);
children.add(new Property("category", "CodeableConcept", "High-level categorization of the type of activity in a care plan.", 0, 1, category));
children.add(new Property("kind", "code", "A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest.", 0, 1, kind));
children.add(new Property("definition", "Reference(PlanDefinition|ActivityDefinition|Questionnaire)", "Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.", 0, 1, definition));
children.add(new Property("code", "CodeableConcept", "Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.", 0, 1, code));
children.add(new Property("reasonCode", "CodeableConcept", "Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.", 0, java.lang.Integer.MAX_VALUE, reasonCode));
@ -1924,7 +2137,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Override
public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
switch (_hash) {
case 50511102: /*category*/ return new Property("category", "CodeableConcept", "High-level categorization of the type of activity in a care plan.", 0, 1, category);
case 3292052: /*kind*/ return new Property("kind", "code", "A description of the kind of resource the in-line definition of a care plan activity is representing. The CarePlan.activity.detail is an in-line definition when a resource is not referenced using CarePlan.activity.reference. For example, a MedicationRequest, a ProcedureRequest, or a CommunicationRequest.", 0, 1, kind);
case -1014418093: /*definition*/ return new Property("definition", "Reference(PlanDefinition|ActivityDefinition|Questionnaire)", "Identifies the protocol, questionnaire, guideline or other specification the planned activity should be conducted in accordance with.", 0, 1, definition);
case 3059181: /*code*/ return new Property("code", "CodeableConcept", "Detailed description of the type of planned activity; e.g. What lab test, what procedure, what kind of encounter.", 0, 1, code);
case 722137681: /*reasonCode*/ return new Property("reasonCode", "CodeableConcept", "Provides the rationale that drove the inclusion of this particular activity as part of the plan or the reason why the activity was prohibited.", 0, java.lang.Integer.MAX_VALUE, reasonCode);
@ -1955,7 +2168,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Override
public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
switch (hash) {
case 50511102: /*category*/ return this.category == null ? new Base[0] : new Base[] {this.category}; // CodeableConcept
case 3292052: /*kind*/ return this.kind == null ? new Base[0] : new Base[] {this.kind}; // Enumeration<CarePlanActivityKind>
case -1014418093: /*definition*/ return this.definition == null ? new Base[0] : new Base[] {this.definition}; // Reference
case 3059181: /*code*/ return this.code == null ? new Base[0] : new Base[] {this.code}; // CodeableConcept
case 722137681: /*reasonCode*/ return this.reasonCode == null ? new Base[0] : this.reasonCode.toArray(new Base[this.reasonCode.size()]); // CodeableConcept
@ -1979,8 +2192,9 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Override
public Base setProperty(int hash, String name, Base value) throws FHIRException {
switch (hash) {
case 50511102: // category
this.category = castToCodeableConcept(value); // CodeableConcept
case 3292052: // kind
value = new CarePlanActivityKindEnumFactory().fromType(castToCode(value));
this.kind = (Enumeration) value; // Enumeration<CarePlanActivityKind>
return value;
case -1014418093: // definition
this.definition = castToReference(value); // Reference
@ -2035,8 +2249,9 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Override
public Base setProperty(String name, Base value) throws FHIRException {
if (name.equals("category")) {
this.category = castToCodeableConcept(value); // CodeableConcept
if (name.equals("kind")) {
value = new CarePlanActivityKindEnumFactory().fromType(castToCode(value));
this.kind = (Enumeration) value; // Enumeration<CarePlanActivityKind>
} else if (name.equals("definition")) {
this.definition = castToReference(value); // Reference
} else if (name.equals("code")) {
@ -2076,7 +2291,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Override
public Base makeProperty(int hash, String name) throws FHIRException {
switch (hash) {
case 50511102: return getCategory();
case 3292052: return getKindElement();
case -1014418093: return getDefinition();
case 3059181: return getCode();
case 722137681: return addReasonCode();
@ -2102,7 +2317,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Override
public String[] getTypesForProperty(int hash, String name) throws FHIRException {
switch (hash) {
case 50511102: /*category*/ return new String[] {"CodeableConcept"};
case 3292052: /*kind*/ return new String[] {"code"};
case -1014418093: /*definition*/ return new String[] {"Reference"};
case 3059181: /*code*/ return new String[] {"CodeableConcept"};
case 722137681: /*reasonCode*/ return new String[] {"CodeableConcept"};
@ -2125,9 +2340,8 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
@Override
public Base addChild(String name) throws FHIRException {
if (name.equals("category")) {
this.category = new CodeableConcept();
return this.category;
if (name.equals("kind")) {
throw new FHIRException("Cannot call addChild on a primitive type CarePlan.kind");
}
else if (name.equals("definition")) {
this.definition = new Reference();
@ -2200,7 +2414,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
public CarePlanActivityDetailComponent copy() {
CarePlanActivityDetailComponent dst = new CarePlanActivityDetailComponent();
copyValues(dst);
dst.category = category == null ? null : category.copy();
dst.kind = kind == null ? null : kind.copy();
dst.definition = definition == null ? null : definition.copy();
dst.code = code == null ? null : code.copy();
if (reasonCode != null) {
@ -2242,7 +2456,7 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
if (!(other instanceof CarePlanActivityDetailComponent))
return false;
CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other;
return compareDeep(category, o.category, true) && compareDeep(definition, o.definition, true) && compareDeep(code, o.code, true)
return compareDeep(kind, o.kind, true) && compareDeep(definition, o.definition, true) && compareDeep(code, o.code, true)
&& compareDeep(reasonCode, o.reasonCode, true) && compareDeep(reasonReference, o.reasonReference, true)
&& compareDeep(goal, o.goal, true) && compareDeep(status, o.status, true) && compareDeep(statusReason, o.statusReason, true)
&& compareDeep(prohibited, o.prohibited, true) && compareDeep(scheduled, o.scheduled, true) && compareDeep(location, o.location, true)
@ -2257,14 +2471,15 @@ Refer to [[[RequestGroup]]] for additional information on how this status is use
if (!(other instanceof CarePlanActivityDetailComponent))
return false;
CarePlanActivityDetailComponent o = (CarePlanActivityDetailComponent) other;
return compareValues(status, o.status, true) && compareValues(statusReason, o.statusReason, true) && compareValues(prohibited, o.prohibited, true)
&& compareValues(description, o.description, true);
return compareValues(kind, o.kind, true) && compareValues(status, o.status, true) && compareValues(statusReason, o.statusReason, true)
&& compareValues(prohibited, o.prohibited, true) && compareValues(description, o.description, true)
;
}
public boolean isEmpty() {
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(category, definition, code
, reasonCode, reasonReference, goal, status, statusReason, prohibited, scheduled
, location, performer, product, dailyAmount, quantity, description);
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(kind, definition, code, reasonCode
, reasonReference, goal, status, statusReason, prohibited, scheduled, location
, performer, product, dailyAmount, quantity, description);
}
public String fhirType() {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

File diff suppressed because it is too large Load Diff

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -2490,10 +2490,17 @@ public class Claim extends DomainResource {
@Description(shortDefinition="Is the focal Coverage", formalDefinition="A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated." )
protected BooleanType focal;
/**
* The business identifier for the instance: claim number, pre-determination or pre-authorization number.
*/
@Child(name = "identifier", type = {Identifier.class}, order=3, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Claim number", formalDefinition="The business identifier for the instance: claim number, pre-determination or pre-authorization number." )
protected Identifier identifier;
/**
* Reference to the program or plan identification, underwriter or payor.
*/
@Child(name = "coverage", type = {Coverage.class}, order=3, min=1, max=1, modifier=false, summary=false)
@Child(name = "coverage", type = {Coverage.class}, order=4, min=1, max=1, modifier=false, summary=false)
@Description(shortDefinition="Insurance information", formalDefinition="Reference to the program or plan identification, underwriter or payor." )
protected Reference coverage;
@ -2505,21 +2512,21 @@ public class Claim extends DomainResource {
/**
* 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, modifier=false, summary=false)
@Child(name = "businessArrangement", type = {StringType.class}, order=5, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Business agreement", formalDefinition="The contract number of a business agreement which describes the terms and conditions." )
protected StringType businessArrangement;
/**
* A list of references from the Insurer to which these services pertain.
*/
@Child(name = "preAuthRef", type = {StringType.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Child(name = "preAuthRef", type = {StringType.class}, order=6, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=false)
@Description(shortDefinition="Pre-Authorization/Determination Reference", formalDefinition="A list of references from the Insurer to which these services pertain." )
protected List<StringType> preAuthRef;
/**
* The Coverages adjudication details.
*/
@Child(name = "claimResponse", type = {ClaimResponse.class}, order=6, min=0, max=1, modifier=false, summary=false)
@Child(name = "claimResponse", type = {ClaimResponse.class}, order=7, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="Adjudication results", formalDefinition="The Coverages adjudication details." )
protected Reference claimResponse;
@ -2528,7 +2535,7 @@ public class Claim extends DomainResource {
*/
protected ClaimResponse claimResponseTarget;
private static final long serialVersionUID = -1216535489L;
private static final long serialVersionUID = -1711744215L;
/**
* Constructor
@ -2637,6 +2644,30 @@ public class Claim extends DomainResource {
return this;
}
/**
* @return {@link #identifier} (The business identifier for the instance: claim number, pre-determination or pre-authorization number.)
*/
public Identifier getIdentifier() {
if (this.identifier == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create InsuranceComponent.identifier");
else if (Configuration.doAutoCreate())
this.identifier = new Identifier(); // cc
return this.identifier;
}
public boolean hasIdentifier() {
return this.identifier != null && !this.identifier.isEmpty();
}
/**
* @param value {@link #identifier} (The business identifier for the instance: claim number, pre-determination or pre-authorization number.)
*/
public InsuranceComponent setIdentifier(Identifier value) {
this.identifier = value;
return this;
}
/**
* @return {@link #coverage} (Reference to the program or plan identification, underwriter or payor.)
*/
@ -2839,6 +2870,7 @@ public class Claim extends DomainResource {
super.listChildren(children);
children.add(new Property("sequence", "positiveInt", "Sequence of coverage which serves to provide a link and convey coordination of benefit order.", 0, 1, sequence));
children.add(new Property("focal", "boolean", "A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, 1, focal));
children.add(new Property("identifier", "Identifier", "The business identifier for the instance: claim number, pre-determination or pre-authorization number.", 0, 1, identifier));
children.add(new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, 1, coverage));
children.add(new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, 1, businessArrangement));
children.add(new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef));
@ -2850,6 +2882,7 @@ public class Claim extends DomainResource {
switch (_hash) {
case 1349547969: /*sequence*/ return new Property("sequence", "positiveInt", "Sequence of coverage which serves to provide a link and convey coordination of benefit order.", 0, 1, sequence);
case 97604197: /*focal*/ return new Property("focal", "boolean", "A flag to indicate that this Coverage is the focus for adjudication. The Coverage against which the claim is to be adjudicated.", 0, 1, focal);
case -1618432855: /*identifier*/ return new Property("identifier", "Identifier", "The business identifier for the instance: claim number, pre-determination or pre-authorization number.", 0, 1, identifier);
case -351767064: /*coverage*/ return new Property("coverage", "Reference(Coverage)", "Reference to the program or plan identification, underwriter or payor.", 0, 1, coverage);
case 259920682: /*businessArrangement*/ return new Property("businessArrangement", "string", "The contract number of a business agreement which describes the terms and conditions.", 0, 1, businessArrangement);
case 522246568: /*preAuthRef*/ return new Property("preAuthRef", "string", "A list of references from the Insurer to which these services pertain.", 0, java.lang.Integer.MAX_VALUE, preAuthRef);
@ -2864,6 +2897,7 @@ public class Claim extends DomainResource {
switch (hash) {
case 1349547969: /*sequence*/ return this.sequence == null ? new Base[0] : new Base[] {this.sequence}; // PositiveIntType
case 97604197: /*focal*/ return this.focal == null ? new Base[0] : new Base[] {this.focal}; // BooleanType
case -1618432855: /*identifier*/ return this.identifier == null ? new Base[0] : new Base[] {this.identifier}; // Identifier
case -351767064: /*coverage*/ return this.coverage == null ? new Base[0] : new Base[] {this.coverage}; // Reference
case 259920682: /*businessArrangement*/ return this.businessArrangement == null ? new Base[0] : new Base[] {this.businessArrangement}; // StringType
case 522246568: /*preAuthRef*/ return this.preAuthRef == null ? new Base[0] : this.preAuthRef.toArray(new Base[this.preAuthRef.size()]); // StringType
@ -2882,6 +2916,9 @@ public class Claim extends DomainResource {
case 97604197: // focal
this.focal = castToBoolean(value); // BooleanType
return value;
case -1618432855: // identifier
this.identifier = castToIdentifier(value); // Identifier
return value;
case -351767064: // coverage
this.coverage = castToReference(value); // Reference
return value;
@ -2905,6 +2942,8 @@ public class Claim extends DomainResource {
this.sequence = castToPositiveInt(value); // PositiveIntType
} else if (name.equals("focal")) {
this.focal = castToBoolean(value); // BooleanType
} else if (name.equals("identifier")) {
this.identifier = castToIdentifier(value); // Identifier
} else if (name.equals("coverage")) {
this.coverage = castToReference(value); // Reference
} else if (name.equals("businessArrangement")) {
@ -2923,6 +2962,7 @@ public class Claim extends DomainResource {
switch (hash) {
case 1349547969: return getSequenceElement();
case 97604197: return getFocalElement();
case -1618432855: return getIdentifier();
case -351767064: return getCoverage();
case 259920682: return getBusinessArrangementElement();
case 522246568: return addPreAuthRefElement();
@ -2937,6 +2977,7 @@ public class Claim extends DomainResource {
switch (hash) {
case 1349547969: /*sequence*/ return new String[] {"positiveInt"};
case 97604197: /*focal*/ return new String[] {"boolean"};
case -1618432855: /*identifier*/ return new String[] {"Identifier"};
case -351767064: /*coverage*/ return new String[] {"Reference"};
case 259920682: /*businessArrangement*/ return new String[] {"string"};
case 522246568: /*preAuthRef*/ return new String[] {"string"};
@ -2954,6 +2995,10 @@ public class Claim extends DomainResource {
else if (name.equals("focal")) {
throw new FHIRException("Cannot call addChild on a primitive type Claim.focal");
}
else if (name.equals("identifier")) {
this.identifier = new Identifier();
return this.identifier;
}
else if (name.equals("coverage")) {
this.coverage = new Reference();
return this.coverage;
@ -2977,6 +3022,7 @@ public class Claim extends DomainResource {
copyValues(dst);
dst.sequence = sequence == null ? null : sequence.copy();
dst.focal = focal == null ? null : focal.copy();
dst.identifier = identifier == null ? null : identifier.copy();
dst.coverage = coverage == null ? null : coverage.copy();
dst.businessArrangement = businessArrangement == null ? null : businessArrangement.copy();
if (preAuthRef != null) {
@ -2995,9 +3041,10 @@ public class Claim extends DomainResource {
if (!(other instanceof InsuranceComponent))
return false;
InsuranceComponent o = (InsuranceComponent) other;
return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(coverage, o.coverage, true)
&& compareDeep(businessArrangement, o.businessArrangement, true) && compareDeep(preAuthRef, o.preAuthRef, true)
&& compareDeep(claimResponse, o.claimResponse, true);
return compareDeep(sequence, o.sequence, true) && compareDeep(focal, o.focal, true) && compareDeep(identifier, o.identifier, true)
&& compareDeep(coverage, o.coverage, true) && compareDeep(businessArrangement, o.businessArrangement, true)
&& compareDeep(preAuthRef, o.preAuthRef, true) && compareDeep(claimResponse, o.claimResponse, true)
;
}
@Override
@ -3012,8 +3059,8 @@ public class Claim extends DomainResource {
}
public boolean isEmpty() {
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, focal, coverage
, businessArrangement, preAuthRef, claimResponse);
return super.isEmpty() && ca.uhn.fhir.util.ElementUtil.isEmpty(sequence, focal, identifier
, coverage, businessArrangement, preAuthRef, claimResponse);
}
public String fhirType() {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -174,6 +174,114 @@ public class ClaimResponse extends DomainResource {
}
}
public enum RemittanceOutcome {
/**
* The processing has completed without errors
*/
COMPLETE,
/**
* One or more errors have been detected in the Claim
*/
ERROR,
/**
* No errors have been detected in the Claim and some of the adjudication has been performed.
*/
PARTIAL,
/**
* added to help the parsers with the generic types
*/
NULL;
public static RemittanceOutcome fromCode(String codeString) throws FHIRException {
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
return COMPLETE;
if ("error".equals(codeString))
return ERROR;
if ("partial".equals(codeString))
return PARTIAL;
if (Configuration.isAcceptInvalidEnums())
return null;
else
throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'");
}
public String toCode() {
switch (this) {
case COMPLETE: return "complete";
case ERROR: return "error";
case PARTIAL: return "partial";
default: return "?";
}
}
public String getSystem() {
switch (this) {
case COMPLETE: return "http://hl7.org/fhir/remittance-outcome";
case ERROR: return "http://hl7.org/fhir/remittance-outcome";
case PARTIAL: return "http://hl7.org/fhir/remittance-outcome";
default: return "?";
}
}
public String getDefinition() {
switch (this) {
case COMPLETE: return "The processing has completed without errors";
case ERROR: return "One or more errors have been detected in the Claim";
case PARTIAL: return "No errors have been detected in the Claim and some of the adjudication has been performed.";
default: return "?";
}
}
public String getDisplay() {
switch (this) {
case COMPLETE: return "Processing Complete";
case ERROR: return "Error";
case PARTIAL: return "Partial Processing";
default: return "?";
}
}
}
public static class RemittanceOutcomeEnumFactory implements EnumFactory<RemittanceOutcome> {
public RemittanceOutcome fromCode(String codeString) throws IllegalArgumentException {
if (codeString == null || "".equals(codeString))
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
return RemittanceOutcome.COMPLETE;
if ("error".equals(codeString))
return RemittanceOutcome.ERROR;
if ("partial".equals(codeString))
return RemittanceOutcome.PARTIAL;
throw new IllegalArgumentException("Unknown RemittanceOutcome code '"+codeString+"'");
}
public Enumeration<RemittanceOutcome> fromType(Base code) throws FHIRException {
if (code == null)
return null;
if (code.isEmpty())
return new Enumeration<RemittanceOutcome>(this);
String codeString = ((PrimitiveType) code).asStringValue();
if (codeString == null || "".equals(codeString))
return null;
if ("complete".equals(codeString))
return new Enumeration<RemittanceOutcome>(this, RemittanceOutcome.COMPLETE);
if ("error".equals(codeString))
return new Enumeration<RemittanceOutcome>(this, RemittanceOutcome.ERROR);
if ("partial".equals(codeString))
return new Enumeration<RemittanceOutcome>(this, RemittanceOutcome.PARTIAL);
throw new FHIRException("Unknown RemittanceOutcome code '"+codeString+"'");
}
public String toCode(RemittanceOutcome code) {
if (code == RemittanceOutcome.COMPLETE)
return "complete";
if (code == RemittanceOutcome.ERROR)
return "error";
if (code == RemittanceOutcome.PARTIAL)
return "partial";
return "?";
}
public String toSystem(RemittanceOutcome code) {
return code.getSystem();
}
}
@Block()
public static class ItemComponent extends BackboneElement implements IBaseBackboneElement {
/**
@ -3201,10 +3309,10 @@ public class ClaimResponse extends DomainResource {
/**
* The note purpose: Print/Display.
*/
@Child(name = "type", type = {CodeableConcept.class}, order=2, min=0, max=1, modifier=false, summary=false)
@Child(name = "type", type = {CodeType.class}, order=2, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="display | print | printoper", formalDefinition="The note purpose: Print/Display." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/note-type")
protected CodeableConcept type;
protected Enumeration<NoteType> type;
/**
* The note text.
@ -3221,7 +3329,7 @@ public class ClaimResponse extends DomainResource {
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/languages")
protected CodeableConcept language;
private static final long serialVersionUID = -944255449L;
private static final long serialVersionUID = -385184277L;
/**
* Constructor
@ -3276,29 +3384,54 @@ public class ClaimResponse extends DomainResource {
}
/**
* @return {@link #type} (The note purpose: Print/Display.)
* @return {@link #type} (The note purpose: Print/Display.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
*/
public CodeableConcept getType() {
public Enumeration<NoteType> getTypeElement() {
if (this.type == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create NoteComponent.type");
else if (Configuration.doAutoCreate())
this.type = new CodeableConcept(); // cc
this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory()); // bb
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 note purpose: Print/Display.)
* @param value {@link #type} (The note purpose: Print/Display.). This is the underlying object with id, value and extensions. The accessor "getType" gives direct access to the value
*/
public NoteComponent setType(CodeableConcept value) {
public NoteComponent setTypeElement(Enumeration<NoteType> value) {
this.type = value;
return this;
}
/**
* @return The note purpose: Print/Display.
*/
public NoteType getType() {
return this.type == null ? null : this.type.getValue();
}
/**
* @param value The note purpose: Print/Display.
*/
public NoteComponent setType(NoteType value) {
if (value == null)
this.type = null;
else {
if (this.type == null)
this.type = new Enumeration<NoteType>(new NoteTypeEnumFactory());
this.type.setValue(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
*/
@ -3375,7 +3508,7 @@ public class ClaimResponse extends DomainResource {
protected void listChildren(List<Property> children) {
super.listChildren(children);
children.add(new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, 1, number));
children.add(new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, 1, type));
children.add(new Property("type", "code", "The note purpose: Print/Display.", 0, 1, type));
children.add(new Property("text", "string", "The note text.", 0, 1, text));
children.add(new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, 1, language));
}
@ -3384,7 +3517,7 @@ public class ClaimResponse extends DomainResource {
public Property getNamedProperty(int _hash, String _name, boolean _checkValid) throws FHIRException {
switch (_hash) {
case -1034364087: /*number*/ return new Property("number", "positiveInt", "An integer associated with each note which may be referred to from each service line item.", 0, 1, number);
case 3575610: /*type*/ return new Property("type", "CodeableConcept", "The note purpose: Print/Display.", 0, 1, type);
case 3575610: /*type*/ return new Property("type", "code", "The note purpose: Print/Display.", 0, 1, type);
case 3556653: /*text*/ return new Property("text", "string", "The note text.", 0, 1, text);
case -1613589672: /*language*/ return new Property("language", "CodeableConcept", "The ISO-639-1 alpha 2 code in lower case for the language, optionally followed by a hyphen and the ISO-3166-1 alpha 2 code for the region in upper case; e.g. \"en\" for English, or \"en-US\" for American English versus \"en-EN\" for England English.", 0, 1, language);
default: return super.getNamedProperty(_hash, _name, _checkValid);
@ -3396,7 +3529,7 @@ public class ClaimResponse extends DomainResource {
public Base[] getProperty(int hash, String name, boolean checkValid) throws FHIRException {
switch (hash) {
case -1034364087: /*number*/ return this.number == null ? new Base[0] : new Base[] {this.number}; // PositiveIntType
case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // CodeableConcept
case 3575610: /*type*/ return this.type == null ? new Base[0] : new Base[] {this.type}; // Enumeration<NoteType>
case 3556653: /*text*/ return this.text == null ? new Base[0] : new Base[] {this.text}; // StringType
case -1613589672: /*language*/ return this.language == null ? new Base[0] : new Base[] {this.language}; // CodeableConcept
default: return super.getProperty(hash, name, checkValid);
@ -3411,7 +3544,8 @@ public class ClaimResponse extends DomainResource {
this.number = castToPositiveInt(value); // PositiveIntType
return value;
case 3575610: // type
this.type = castToCodeableConcept(value); // CodeableConcept
value = new NoteTypeEnumFactory().fromType(castToCode(value));
this.type = (Enumeration) value; // Enumeration<NoteType>
return value;
case 3556653: // text
this.text = castToString(value); // StringType
@ -3429,7 +3563,8 @@ public class ClaimResponse extends DomainResource {
if (name.equals("number")) {
this.number = castToPositiveInt(value); // PositiveIntType
} else if (name.equals("type")) {
this.type = castToCodeableConcept(value); // CodeableConcept
value = new NoteTypeEnumFactory().fromType(castToCode(value));
this.type = (Enumeration) value; // Enumeration<NoteType>
} else if (name.equals("text")) {
this.text = castToString(value); // StringType
} else if (name.equals("language")) {
@ -3443,7 +3578,7 @@ public class ClaimResponse extends DomainResource {
public Base makeProperty(int hash, String name) throws FHIRException {
switch (hash) {
case -1034364087: return getNumberElement();
case 3575610: return getType();
case 3575610: return getTypeElement();
case 3556653: return getTextElement();
case -1613589672: return getLanguage();
default: return super.makeProperty(hash, name);
@ -3455,7 +3590,7 @@ public class ClaimResponse extends DomainResource {
public String[] getTypesForProperty(int hash, String name) throws FHIRException {
switch (hash) {
case -1034364087: /*number*/ return new String[] {"positiveInt"};
case 3575610: /*type*/ return new String[] {"CodeableConcept"};
case 3575610: /*type*/ return new String[] {"code"};
case 3556653: /*text*/ return new String[] {"string"};
case -1613589672: /*language*/ return new String[] {"CodeableConcept"};
default: return super.getTypesForProperty(hash, name);
@ -3469,8 +3604,7 @@ public class ClaimResponse extends DomainResource {
throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.number");
}
else if (name.equals("type")) {
this.type = new CodeableConcept();
return this.type;
throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.type");
}
else if (name.equals("text")) {
throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.text");
@ -3511,7 +3645,8 @@ public class ClaimResponse extends DomainResource {
if (!(other instanceof NoteComponent))
return false;
NoteComponent o = (NoteComponent) other;
return compareValues(number, o.number, true) && compareValues(text, o.text, true);
return compareValues(number, o.number, true) && compareValues(type, o.type, true) && compareValues(text, o.text, true)
;
}
public boolean isEmpty() {
@ -4158,12 +4293,12 @@ public class ClaimResponse extends DomainResource {
protected Claim requestTarget;
/**
* Processing outcome errror, partial or complete processing.
* Transaction: error, complete, partial processing.
*/
@Child(name = "outcome", type = {CodeableConcept.class}, order=8, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="complete | error | partial", formalDefinition="Processing outcome errror, partial or complete processing." )
@Child(name = "outcome", type = {CodeType.class}, order=8, min=0, max=1, modifier=false, summary=false)
@Description(shortDefinition="complete | error | partial", formalDefinition="Transaction: error, complete, partial processing." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/remittance-outcome")
protected CodeableConcept outcome;
protected Enumeration<RemittanceOutcome> outcome;
/**
* A description of the status of the adjudication.
@ -4271,7 +4406,7 @@ public class ClaimResponse extends DomainResource {
@Description(shortDefinition="Insurance or medical plan", formalDefinition="Financial instrument by which payment information for health care." )
protected List<InsuranceComponent> insurance;
private static final long serialVersionUID = -488591755L;
private static final long serialVersionUID = 676985103L;
/**
* Constructor
@ -4652,29 +4787,54 @@ public class ClaimResponse extends DomainResource {
}
/**
* @return {@link #outcome} (Processing outcome errror, partial or complete processing.)
* @return {@link #outcome} (Transaction: error, complete, partial processing.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
*/
public CodeableConcept getOutcome() {
public Enumeration<RemittanceOutcome> getOutcomeElement() {
if (this.outcome == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create ClaimResponse.outcome");
else if (Configuration.doAutoCreate())
this.outcome = new CodeableConcept(); // cc
this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory()); // bb
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} (Processing outcome errror, partial or complete processing.)
* @param value {@link #outcome} (Transaction: error, complete, partial processing.). This is the underlying object with id, value and extensions. The accessor "getOutcome" gives direct access to the value
*/
public ClaimResponse setOutcome(CodeableConcept value) {
public ClaimResponse setOutcomeElement(Enumeration<RemittanceOutcome> value) {
this.outcome = value;
return this;
}
/**
* @return Transaction: error, complete, partial processing.
*/
public RemittanceOutcome getOutcome() {
return this.outcome == null ? null : this.outcome.getValue();
}
/**
* @param value Transaction: error, complete, partial processing.
*/
public ClaimResponse setOutcome(RemittanceOutcome value) {
if (value == null)
this.outcome = null;
else {
if (this.outcome == null)
this.outcome = new Enumeration<RemittanceOutcome>(new RemittanceOutcomeEnumFactory());
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
*/
@ -5242,7 +5402,7 @@ public class ClaimResponse extends DomainResource {
children.add(new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestProvider));
children.add(new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, 1, requestOrganization));
children.add(new Property("request", "Reference(Claim)", "Original request resource referrence.", 0, 1, request));
children.add(new Property("outcome", "CodeableConcept", "Processing outcome errror, partial or complete processing.", 0, 1, outcome));
children.add(new Property("outcome", "code", "Transaction: error, complete, partial processing.", 0, 1, outcome));
children.add(new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition));
children.add(new Property("payeeType", "CodeableConcept", "Party to be reimbursed: Subscriber, provider, other.", 0, 1, payeeType));
children.add(new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item));
@ -5270,7 +5430,7 @@ public class ClaimResponse extends DomainResource {
case 1601527200: /*requestProvider*/ return new Property("requestProvider", "Reference(Practitioner)", "The practitioner who is responsible for the services rendered to the patient.", 0, 1, requestProvider);
case 599053666: /*requestOrganization*/ return new Property("requestOrganization", "Reference(Organization)", "The organization which is responsible for the services rendered to the patient.", 0, 1, requestOrganization);
case 1095692943: /*request*/ return new Property("request", "Reference(Claim)", "Original request resource referrence.", 0, 1, request);
case -1106507950: /*outcome*/ return new Property("outcome", "CodeableConcept", "Processing outcome errror, partial or complete processing.", 0, 1, outcome);
case -1106507950: /*outcome*/ return new Property("outcome", "code", "Transaction: error, complete, partial processing.", 0, 1, outcome);
case 583380919: /*disposition*/ return new Property("disposition", "string", "A description of the status of the adjudication.", 0, 1, disposition);
case -316321118: /*payeeType*/ return new Property("payeeType", "CodeableConcept", "Party to be reimbursed: Subscriber, provider, other.", 0, 1, payeeType);
case 3242771: /*item*/ return new Property("item", "", "The first tier service adjudications for submitted services.", 0, java.lang.Integer.MAX_VALUE, item);
@ -5301,7 +5461,7 @@ public class ClaimResponse extends DomainResource {
case 1601527200: /*requestProvider*/ return this.requestProvider == null ? new Base[0] : new Base[] {this.requestProvider}; // Reference
case 599053666: /*requestOrganization*/ return this.requestOrganization == null ? new Base[0] : new Base[] {this.requestOrganization}; // Reference
case 1095692943: /*request*/ return this.request == null ? new Base[0] : new Base[] {this.request}; // Reference
case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // CodeableConcept
case -1106507950: /*outcome*/ return this.outcome == null ? new Base[0] : new Base[] {this.outcome}; // Enumeration<RemittanceOutcome>
case 583380919: /*disposition*/ return this.disposition == null ? new Base[0] : new Base[] {this.disposition}; // StringType
case -316321118: /*payeeType*/ return this.payeeType == null ? new Base[0] : new Base[] {this.payeeType}; // CodeableConcept
case 3242771: /*item*/ return this.item == null ? new Base[0] : this.item.toArray(new Base[this.item.size()]); // ItemComponent
@ -5350,7 +5510,8 @@ public class ClaimResponse extends DomainResource {
this.request = castToReference(value); // Reference
return value;
case -1106507950: // outcome
this.outcome = castToCodeableConcept(value); // CodeableConcept
value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value));
this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
return value;
case 583380919: // disposition
this.disposition = castToString(value); // StringType
@ -5419,7 +5580,8 @@ public class ClaimResponse extends DomainResource {
} else if (name.equals("request")) {
this.request = castToReference(value); // Reference
} else if (name.equals("outcome")) {
this.outcome = castToCodeableConcept(value); // CodeableConcept
value = new RemittanceOutcomeEnumFactory().fromType(castToCode(value));
this.outcome = (Enumeration) value; // Enumeration<RemittanceOutcome>
} else if (name.equals("disposition")) {
this.disposition = castToString(value); // StringType
} else if (name.equals("payeeType")) {
@ -5464,7 +5626,7 @@ public class ClaimResponse extends DomainResource {
case 1601527200: return getRequestProvider();
case 599053666: return getRequestOrganization();
case 1095692943: return getRequest();
case -1106507950: return getOutcome();
case -1106507950: return getOutcomeElement();
case 583380919: return getDispositionElement();
case -316321118: return getPayeeType();
case 3242771: return addItem();
@ -5495,7 +5657,7 @@ public class ClaimResponse extends DomainResource {
case 1601527200: /*requestProvider*/ return new String[] {"Reference"};
case 599053666: /*requestOrganization*/ return new String[] {"Reference"};
case 1095692943: /*request*/ return new String[] {"Reference"};
case -1106507950: /*outcome*/ return new String[] {"CodeableConcept"};
case -1106507950: /*outcome*/ return new String[] {"code"};
case 583380919: /*disposition*/ return new String[] {"string"};
case -316321118: /*payeeType*/ return new String[] {"CodeableConcept"};
case 3242771: /*item*/ return new String[] {};
@ -5547,8 +5709,7 @@ public class ClaimResponse extends DomainResource {
return this.request;
}
else if (name.equals("outcome")) {
this.outcome = new CodeableConcept();
return this.outcome;
throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.outcome");
}
else if (name.equals("disposition")) {
throw new FHIRException("Cannot call addChild on a primitive type ClaimResponse.disposition");
@ -5694,8 +5855,8 @@ public class ClaimResponse extends DomainResource {
if (!(other instanceof ClaimResponse))
return false;
ClaimResponse o = (ClaimResponse) other;
return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(disposition, o.disposition, true)
;
return compareValues(status, o.status, true) && compareValues(created, o.created, true) && compareValues(outcome, o.outcome, true)
&& compareValues(disposition, o.disposition, true);
}
public boolean isEmpty() {

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -513,6 +513,7 @@ public class Coding extends Type implements IBaseCoding, ICompositeType, ICoding
, userSelected);
}
// added from java-adornments.txt:
@Override
public boolean supportsVersion() {
return true;
@ -524,5 +525,7 @@ public class Coding extends Type implements IBaseCoding, ICompositeType, ICoding
}
// end addition
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -704,7 +704,7 @@ public class Composition extends DomainResource {
/**
* Who attested the composition in the specified way.
*/
@Child(name = "party", type = {Patient.class, Practitioner.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true)
@Child(name = "party", type = {Patient.class, Practitioner.class, PractitionerRole.class, Organization.class}, order=3, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Who attested the composition", formalDefinition="Who attested the composition in the specified way." )
protected Reference party;
@ -875,7 +875,7 @@ public class Composition extends DomainResource {
super.listChildren(children);
children.add(new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode));
children.add(new Property("time", "dateTime", "When the composition was attested by the party.", 0, 1, time));
children.add(new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, 1, party));
children.add(new Property("party", "Reference(Patient|Practitioner|PractitionerRole|Organization)", "Who attested the composition in the specified way.", 0, 1, party));
}
@Override
@ -883,7 +883,7 @@ public class Composition extends DomainResource {
switch (_hash) {
case 3357091: /*mode*/ return new Property("mode", "code", "The type of attestation the authenticator offers.", 0, java.lang.Integer.MAX_VALUE, mode);
case 3560141: /*time*/ return new Property("time", "dateTime", "When the composition was attested by the party.", 0, 1, time);
case 106437350: /*party*/ return new Property("party", "Reference(Patient|Practitioner|Organization)", "Who attested the composition in the specified way.", 0, 1, party);
case 106437350: /*party*/ return new Property("party", "Reference(Patient|Practitioner|PractitionerRole|Organization)", "Who attested the composition in the specified way.", 0, 1, party);
default: return super.getNamedProperty(_hash, _name, _checkValid);
}
@ -2271,7 +2271,7 @@ public class Composition extends DomainResource {
/**
* 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, modifier=false, summary=true)
@Child(name = "author", type = {Practitioner.class, PractitionerRole.class, Device.class, Patient.class, RelatedPerson.class}, order=7, min=1, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
@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<Reference> author;
/**
@ -3023,7 +3023,7 @@ public class Composition extends DomainResource {
children.add(new Property("subject", "Reference(Any)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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, 1, subject));
children.add(new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, 1, encounter));
children.add(new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, 1, date));
children.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));
children.add(new Property("author", "Reference(Practitioner|PractitionerRole|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));
children.add(new Property("title", "string", "Official human-readable label for the composition.", 0, 1, title));
children.add(new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, 1, confidentiality));
children.add(new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester));
@ -3043,7 +3043,7 @@ public class Composition extends DomainResource {
case -1867885268: /*subject*/ return new Property("subject", "Reference(Any)", "Who or what the composition is about. The composition can be about a person, (patient or healthcare practitioner), a device (e.g. a 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, 1, subject);
case 1524132147: /*encounter*/ return new Property("encounter", "Reference(Encounter)", "Describes the clinical encounter or type of care this documentation is associated with.", 0, 1, encounter);
case 3076014: /*date*/ return new Property("date", "dateTime", "The composition editing time, when the composition was last logically changed by the author.", 0, 1, date);
case -1406328437: /*author*/ return 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);
case -1406328437: /*author*/ return new Property("author", "Reference(Practitioner|PractitionerRole|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);
case 110371416: /*title*/ return new Property("title", "string", "Official human-readable label for the composition.", 0, 1, title);
case -1923018202: /*confidentiality*/ return new Property("confidentiality", "code", "The code specifying the level of confidentiality of the Composition.", 0, 1, confidentiality);
case 542920370: /*attester*/ return new Property("attester", "", "A participant who has attested to the accuracy of the composition/document.", 0, java.lang.Integer.MAX_VALUE, attester);
@ -3477,7 +3477,7 @@ public class Composition extends DomainResource {
* Path: <b>Composition.author</b><br>
* </p>
*/
@SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Patient.class, Practitioner.class, RelatedPerson.class } )
@SearchParamDefinition(name="author", path="Composition.author", description="Who and/or what authored the composition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Device"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner"), @ca.uhn.fhir.model.api.annotation.Compartment(name="RelatedPerson") }, target={Device.class, Patient.class, Practitioner.class, PractitionerRole.class, RelatedPerson.class } )
public static final String SP_AUTHOR = "author";
/**
* <b>Fluent Client</b> search parameter constant for <b>author</b>
@ -3609,7 +3609,7 @@ public class Composition extends DomainResource {
* Path: <b>Composition.attester.party</b><br>
* </p>
*/
@SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Organization.class, Patient.class, Practitioner.class } )
@SearchParamDefinition(name="attester", path="Composition.attester.party", description="Who attested the composition", type="reference", providesMembershipIn={ @ca.uhn.fhir.model.api.annotation.Compartment(name="Patient"), @ca.uhn.fhir.model.api.annotation.Compartment(name="Practitioner") }, target={Organization.class, Patient.class, Practitioner.class, PractitionerRole.class } )
public static final String SP_ATTESTER = "attester";
/**
* <b>Fluent Client</b> search parameter constant for <b>attester</b>

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;
@ -1017,10 +1017,10 @@ public class Consent extends DomainResource {
protected List<CodeableConcept> action;
/**
* A set of security labels that define which resources are controlled by this rule. If more than one label is specified, all resources must have all the specified labels.
* A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.
*/
@Child(name = "securityLabel", type = {Coding.class}, order=5, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
@Description(shortDefinition="Security Labels that define affected resources", formalDefinition="A set of security labels that define which resources are controlled by this rule. If more than one label is specified, all resources must have all the specified labels." )
@Description(shortDefinition="Security Labels that define affected resources", formalDefinition="A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/security-labels")
protected List<Coding> securityLabel;
@ -1258,7 +1258,7 @@ public class Consent extends DomainResource {
}
/**
* @return {@link #securityLabel} (A set of security labels that define which resources are controlled by this rule. If more than one label is specified, all resources must have all the specified labels.)
* @return {@link #securityLabel} (A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.)
*/
public List<Coding> getSecurityLabel() {
if (this.securityLabel == null)
@ -1605,7 +1605,7 @@ public class Consent extends DomainResource {
children.add(new Property("period", "Period", "The timeframe in this rule is valid.", 0, 1, period));
children.add(new Property("actor", "", "Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').", 0, java.lang.Integer.MAX_VALUE, actor));
children.add(new Property("action", "CodeableConcept", "Actions controlled by this Rule.", 0, java.lang.Integer.MAX_VALUE, action));
children.add(new Property("securityLabel", "Coding", "A set of security labels that define which resources are controlled by this rule. If more than one label is specified, all resources must have all the specified labels.", 0, java.lang.Integer.MAX_VALUE, securityLabel));
children.add(new Property("securityLabel", "Coding", "A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.", 0, java.lang.Integer.MAX_VALUE, securityLabel));
children.add(new Property("purpose", "Coding", "The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.", 0, java.lang.Integer.MAX_VALUE, purpose));
children.add(new Property("class", "Coding", "The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.", 0, java.lang.Integer.MAX_VALUE, class_));
children.add(new Property("code", "Coding", "If this code is found in an instance, then the rule applies.", 0, java.lang.Integer.MAX_VALUE, code));
@ -1621,7 +1621,7 @@ public class Consent extends DomainResource {
case -991726143: /*period*/ return new Property("period", "Period", "The timeframe in this rule is valid.", 0, 1, period);
case 92645877: /*actor*/ return new Property("actor", "", "Who or what is controlled by this rule. Use group to identify a set of actors by some property they share (e.g. 'admitting officers').", 0, java.lang.Integer.MAX_VALUE, actor);
case -1422950858: /*action*/ return new Property("action", "CodeableConcept", "Actions controlled by this Rule.", 0, java.lang.Integer.MAX_VALUE, action);
case -722296940: /*securityLabel*/ return new Property("securityLabel", "Coding", "A set of security labels that define which resources are controlled by this rule. If more than one label is specified, all resources must have all the specified labels.", 0, java.lang.Integer.MAX_VALUE, securityLabel);
case -722296940: /*securityLabel*/ return new Property("securityLabel", "Coding", "A security label, comprised of 0..* security label fields (Privacy tags), which define which resources are controlled by this exception.", 0, java.lang.Integer.MAX_VALUE, securityLabel);
case -220463842: /*purpose*/ return new Property("purpose", "Coding", "The context of the activities a user is taking - why the user is accessing the data - that are controlled by this rule.", 0, java.lang.Integer.MAX_VALUE, purpose);
case 94742904: /*class*/ return new Property("class", "Coding", "The class of information covered by this rule. The type can be a FHIR resource type, a profile on a type, or a CDA document, or some other type that indicates what sort of information the consent relates to.", 0, java.lang.Integer.MAX_VALUE, class_);
case 3059181: /*code*/ return new Property("code", "Coding", "If this code is found in an instance, then the rule applies.", 0, java.lang.Integer.MAX_VALUE, code);
@ -2444,11 +2444,12 @@ public class Consent extends DomainResource {
protected List<ConsentPolicyComponent> policy;
/**
* A referece to the specific computable policy.
* A reference to the specific base computable policy.
*/
@Child(name = "policyRule", type = {UriType.class}, order=9, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Policy that this consents to", formalDefinition="A referece to the specific computable policy." )
protected UriType policyRule;
@Child(name = "policyRule", type = {CodeableConcept.class}, order=9, min=0, max=1, modifier=false, summary=true)
@Description(shortDefinition="Policy that this consents to", formalDefinition="A reference to the specific base computable policy." )
@ca.uhn.fhir.model.api.annotation.Binding(valueSet="http://hl7.org/fhir/ValueSet/v3-ActConsentDirective")
protected CodeableConcept policyRule;
/**
* Whether a treatment instruction (e.g. artifical respiration yes or no) was verified with the patient, his/her family or another authorized person.
@ -2461,10 +2462,10 @@ public class Consent extends DomainResource {
* An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.
*/
@Child(name = "provision", type = {}, order=11, min=0, max=Child.MAX_UNLIMITED, modifier=false, summary=true)
@Description(shortDefinition="Consent provision - addition or removal of permissions", formalDefinition="An exception to the base policy of this consent. An exception can be an addition or removal of access permissions." )
@Description(shortDefinition="Constraints to the base Consent.policyRule", formalDefinition="An exception to the base policy of this consent. An exception can be an addition or removal of access permissions." )
protected List<provisionComponent> provision;
private static final long serialVersionUID = -79499195L;
private static final long serialVersionUID = -83391542L;
/**
* Constructor
@ -2947,54 +2948,29 @@ public class Consent extends DomainResource {
}
/**
* @return {@link #policyRule} (A referece to the specific computable policy.). This is the underlying object with id, value and extensions. The accessor "getPolicyRule" gives direct access to the value
* @return {@link #policyRule} (A reference to the specific base computable policy.)
*/
public UriType getPolicyRuleElement() {
public CodeableConcept getPolicyRule() {
if (this.policyRule == null)
if (Configuration.errorOnAutoCreate())
throw new Error("Attempt to auto-create Consent.policyRule");
else if (Configuration.doAutoCreate())
this.policyRule = new UriType(); // bb
this.policyRule = new CodeableConcept(); // cc
return this.policyRule;
}
public boolean hasPolicyRuleElement() {
return this.policyRule != null && !this.policyRule.isEmpty();
}
public boolean hasPolicyRule() {
return this.policyRule != null && !this.policyRule.isEmpty();
}
/**
* @param value {@link #policyRule} (A referece to the specific computable policy.). This is the underlying object with id, value and extensions. The accessor "getPolicyRule" gives direct access to the value
* @param value {@link #policyRule} (A reference to the specific base computable policy.)
*/
public Consent setPolicyRuleElement(UriType value) {
public Consent setPolicyRule(CodeableConcept value) {
this.policyRule = value;
return this;
}
/**
* @return A referece to the specific computable policy.
*/
public String getPolicyRule() {
return this.policyRule == null ? null : this.policyRule.getValue();
}
/**
* @param value A referece to the specific computable policy.
*/
public Consent setPolicyRule(String value) {
if (Utilities.noString(value))
this.policyRule = null;
else {
if (this.policyRule == null)
this.policyRule = new UriType();
this.policyRule.setValue(value);
}
return this;
}
/**
* @return {@link #verification} (Whether a treatment instruction (e.g. artifical respiration yes or no) was verified with the patient, his/her family or another authorized person.)
*/
@ -3112,7 +3088,7 @@ public class Consent extends DomainResource {
children.add(new Property("organization", "Reference(Organization)", "The organization that manages the consent, and the framework within which it is executed.", 0, java.lang.Integer.MAX_VALUE, organization));
children.add(new Property("source[x]", "Attachment|Identifier|Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.", 0, 1, source));
children.add(new Property("policy", "", "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.", 0, java.lang.Integer.MAX_VALUE, policy));
children.add(new Property("policyRule", "uri", "A referece to the specific computable policy.", 0, 1, policyRule));
children.add(new Property("policyRule", "CodeableConcept", "A reference to the specific base computable policy.", 0, 1, policyRule));
children.add(new Property("verification", "", "Whether a treatment instruction (e.g. artifical respiration yes or no) was verified with the patient, his/her family or another authorized person.", 0, java.lang.Integer.MAX_VALUE, verification));
children.add(new Property("provision", "", "An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.", 0, java.lang.Integer.MAX_VALUE, provision));
}
@ -3133,7 +3109,7 @@ public class Consent extends DomainResource {
case -1985492188: /*sourceIdentifier*/ return new Property("source[x]", "Attachment|Identifier|Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.", 0, 1, source);
case -244259472: /*sourceReference*/ return new Property("source[x]", "Attachment|Identifier|Reference(Consent|DocumentReference|Contract|QuestionnaireResponse)", "The source on which this consent statement is based. The source might be a scanned original paper form, or a reference to a consent that links back to such a source, a reference to a document repository (e.g. XDS) that stores the original consent document.", 0, 1, source);
case -982670030: /*policy*/ return new Property("policy", "", "The references to the policies that are included in this consent scope. Policies may be organizational, but are often defined jurisdictionally, or in law.", 0, java.lang.Integer.MAX_VALUE, policy);
case 1593493326: /*policyRule*/ return new Property("policyRule", "uri", "A referece to the specific computable policy.", 0, 1, policyRule);
case 1593493326: /*policyRule*/ return new Property("policyRule", "CodeableConcept", "A reference to the specific base computable policy.", 0, 1, policyRule);
case -1484401125: /*verification*/ return new Property("verification", "", "Whether a treatment instruction (e.g. artifical respiration yes or no) was verified with the patient, his/her family or another authorized person.", 0, java.lang.Integer.MAX_VALUE, verification);
case -547120939: /*provision*/ return new Property("provision", "", "An exception to the base policy of this consent. An exception can be an addition or removal of access permissions.", 0, java.lang.Integer.MAX_VALUE, provision);
default: return super.getNamedProperty(_hash, _name, _checkValid);
@ -3153,7 +3129,7 @@ public class Consent extends DomainResource {
case 1178922291: /*organization*/ return this.organization == null ? new Base[0] : this.organization.toArray(new Base[this.organization.size()]); // Reference
case -896505829: /*source*/ return this.source == null ? new Base[0] : new Base[] {this.source}; // Type
case -982670030: /*policy*/ return this.policy == null ? new Base[0] : this.policy.toArray(new Base[this.policy.size()]); // ConsentPolicyComponent
case 1593493326: /*policyRule*/ return this.policyRule == null ? new Base[0] : new Base[] {this.policyRule}; // UriType
case 1593493326: /*policyRule*/ return this.policyRule == null ? new Base[0] : new Base[] {this.policyRule}; // CodeableConcept
case -1484401125: /*verification*/ return this.verification == null ? new Base[0] : this.verification.toArray(new Base[this.verification.size()]); // ConsentVerificationComponent
case -547120939: /*provision*/ return this.provision == null ? new Base[0] : this.provision.toArray(new Base[this.provision.size()]); // provisionComponent
default: return super.getProperty(hash, name, checkValid);
@ -3193,7 +3169,7 @@ public class Consent extends DomainResource {
this.getPolicy().add((ConsentPolicyComponent) value); // ConsentPolicyComponent
return value;
case 1593493326: // policyRule
this.policyRule = castToUri(value); // UriType
this.policyRule = castToCodeableConcept(value); // CodeableConcept
return value;
case -1484401125: // verification
this.getVerification().add((ConsentVerificationComponent) value); // ConsentVerificationComponent
@ -3228,7 +3204,7 @@ public class Consent extends DomainResource {
} else if (name.equals("policy")) {
this.getPolicy().add((ConsentPolicyComponent) value);
} else if (name.equals("policyRule")) {
this.policyRule = castToUri(value); // UriType
this.policyRule = castToCodeableConcept(value); // CodeableConcept
} else if (name.equals("verification")) {
this.getVerification().add((ConsentVerificationComponent) value);
} else if (name.equals("provision")) {
@ -3251,7 +3227,7 @@ public class Consent extends DomainResource {
case -1698413947: return getSource();
case -896505829: return getSource();
case -982670030: return addPolicy();
case 1593493326: return getPolicyRuleElement();
case 1593493326: return getPolicyRule();
case -1484401125: return addVerification();
case -547120939: return addProvision();
default: return super.makeProperty(hash, name);
@ -3271,7 +3247,7 @@ public class Consent extends DomainResource {
case 1178922291: /*organization*/ return new String[] {"Reference"};
case -896505829: /*source*/ return new String[] {"Attachment", "Identifier", "Reference"};
case -982670030: /*policy*/ return new String[] {};
case 1593493326: /*policyRule*/ return new String[] {"uri"};
case 1593493326: /*policyRule*/ return new String[] {"CodeableConcept"};
case -1484401125: /*verification*/ return new String[] {};
case -547120939: /*provision*/ return new String[] {};
default: return super.getTypesForProperty(hash, name);
@ -3320,7 +3296,8 @@ public class Consent extends DomainResource {
return addPolicy();
}
else if (name.equals("policyRule")) {
throw new FHIRException("Cannot call addChild on a primitive type Consent.policyRule");
this.policyRule = new CodeableConcept();
return this.policyRule;
}
else if (name.equals("verification")) {
return addVerification();
@ -3404,8 +3381,7 @@ public class Consent extends DomainResource {
if (!(other instanceof Consent))
return false;
Consent o = (Consent) other;
return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true) && compareValues(policyRule, o.policyRule, true)
;
return compareValues(status, o.status, true) && compareValues(dateTime, o.dateTime, true);
}
public boolean isEmpty() {

View File

@ -29,12 +29,12 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
public class Constants {
public final static String VERSION = "3.1.0";
public final static String REVISION = "12192";
public final static String DATE = "Sat Jul 08 23:19:48 AEST 2017";
public final static String REVISION = "12370";
public final static String DATE = "Sat Sep 23 17:56:09 EDT 2017";
}

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

View File

@ -29,7 +29,7 @@ package org.hl7.fhir.r4.model;
*/
// Generated on Sat, Jul 8, 2017 23:19+1000 for FHIR v3.1.0
// Generated on Sat, Sep 23, 2017 17:56-0400 for FHIR v3.1.0
import java.util.*;

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