diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java index 418f1af4e22..364eefe462f 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/api/MethodOutcome.java @@ -62,6 +62,9 @@ public class MethodOutcome { return myOperationOutcome; } + /** + * @deprecated {@link MethodOutcome#getId()} should return the complete ID including version if it is available + */ public IdDt getVersionId() { return myVersionId; } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java index 5b47c6ff9b5..c29b2d0d8c6 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/BaseClient.java @@ -33,6 +33,7 @@ import java.util.List; import java.util.Map; import org.apache.commons.io.IOUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.http.Header; import org.apache.http.HttpEntity; import org.apache.http.HttpResponse; @@ -127,13 +128,22 @@ public abstract class BaseClient { Reader reader = createReaderFromResponse(response); - if (ourLog.isTraceEnabled() || myKeepResponses) { + if (ourLog.isTraceEnabled() || myKeepResponses || theLogRequestAndResponse) { String responseString = IOUtils.toString(reader); if (myKeepResponses) { myLastResponse = response; myLastResponseBody = responseString; } - ourLog.trace("FHIR response:\n{}\n{}", response, responseString); + if (theLogRequestAndResponse) { + String message = "HTTP " + response.getStatusLine().getStatusCode()+" " +response.getStatusLine().getReasonPhrase(); + if (StringUtils.isNotBlank(responseString)) { + ourLog.info("Client response: {}\n{}", message, responseString); + }else { + ourLog.info("Client response: {}", message, responseString); + } + }else { + ourLog.trace("FHIR response:\n{}\n{}", response, responseString); + } reader = new StringReader(responseString); } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java index 7e30fa0478d..d421f7bd6ba 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/GenericClient.java @@ -71,6 +71,8 @@ public class GenericClient extends BaseClient implements IGenericClient { private HttpRequestBase myLastRequest; + private boolean myLogRequestAndResponse; + /** * For now, this is a part of the internal API of HAPI - Use with caution as this method may change! */ @@ -87,7 +89,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } ResourceResponseHandler binding = new ResourceResponseHandler(Conformance.class); - Conformance resp = invokeClient(binding, invocation); + Conformance resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -103,7 +105,7 @@ public class GenericClient extends BaseClient implements IGenericClient { OutcomeResponseHandler binding = new OutcomeResponseHandler(resourceName); - MethodOutcome resp = invokeClient(binding, invocation); + MethodOutcome resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -117,7 +119,7 @@ public class GenericClient extends BaseClient implements IGenericClient { final String resourceName = myContext.getResourceDefinition(theType).getName(); OutcomeResponseHandler binding = new OutcomeResponseHandler(resourceName); - MethodOutcome resp = invokeClient(binding, invocation); + MethodOutcome resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -138,7 +140,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } BundleResponseHandler binding = new BundleResponseHandler(theType); - Bundle resp = invokeClient(binding, invocation); + Bundle resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -148,6 +150,10 @@ public class GenericClient extends BaseClient implements IGenericClient { return history(theType, new IdDt(theId)); } + public boolean isLogRequestAndResponse() { + return myLogRequestAndResponse; + } + @Override public T read(final Class theType, IdDt theId) { HttpGetClientInvocation invocation = ReadMethodBinding.createReadInvocation(theId, toResourceName(theType)); @@ -156,7 +162,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } ResourceResponseHandler binding = new ResourceResponseHandler(theType); - T resp = invokeClient(binding, invocation); + T resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -181,7 +187,7 @@ public class GenericClient extends BaseClient implements IGenericClient { qualifier = nextValue.getQueryParameterQualifier(); } qualifier = StringUtils.defaultString(qualifier); - params.put(nextEntry.getKey()+qualifier, valueList); + params.put(nextEntry.getKey() + qualifier, valueList); } HttpGetClientInvocation invocation = SearchMethodBinding.createSearchInvocation(toResourceName(theType), params); @@ -190,7 +196,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } BundleResponseHandler binding = new BundleResponseHandler(theType); - Bundle resp = invokeClient(binding, invocation); + Bundle resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -201,6 +207,15 @@ public class GenericClient extends BaseClient implements IGenericClient { myLastRequest = theLastRequest; } + @Override + public void setLogRequestAndResponse(boolean theLogRequestAndResponse) { + myLogRequestAndResponse = theLogRequestAndResponse; + } + + private String toResourceName(Class theType) { + return myContext.getResourceDefinition(theType).getName(); + } + @Override public MethodOutcome update(IdDt theIdDt, IResource theResource) { BaseHttpClientInvocation invocation = UpdateMethodBinding.createUpdateInvocation(theResource, theIdDt, null, myContext); @@ -212,7 +227,7 @@ public class GenericClient extends BaseClient implements IGenericClient { final String resourceName = def.getName(); OutcomeResponseHandler binding = new OutcomeResponseHandler(resourceName); - MethodOutcome resp = invokeClient(binding, invocation); + MethodOutcome resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -232,7 +247,7 @@ public class GenericClient extends BaseClient implements IGenericClient { final String resourceName = def.getName(); OutcomeResponseHandler binding = new OutcomeResponseHandler(resourceName); - MethodOutcome resp = invokeClient(binding, invocation); + MethodOutcome resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -244,7 +259,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } ResourceResponseHandler binding = new ResourceResponseHandler(theType); - T resp = invokeClient(binding, invocation); + T resp = invokeClient(binding, invocation, myLogRequestAndResponse); return resp; } @@ -253,41 +268,6 @@ public class GenericClient extends BaseClient implements IGenericClient { return vread(theType, new IdDt(theId), new IdDt(theVersionId)); } - private String toResourceName(Class theType) { - return myContext.getResourceDefinition(theType).getName(); - } - - private final class OutcomeResponseHandler implements IClientResponseHandler { - private final String myResourceName; - - private OutcomeResponseHandler(String theResourceName) { - myResourceName = theResourceName; - } - - @Override - public MethodOutcome invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, - BaseServerResponseException { - MethodOutcome response = BaseOutcomeReturningMethodBinding.process2xxResponse(myContext, myResourceName, theResponseStatusCode, theResponseMimeType, theResponseReader, theHeaders); - return response; - } - } - - private final class ResourceResponseHandler implements IClientResponseHandler { - - private Class myType; - - public ResourceResponseHandler(Class theType) { - myType = theType; - } - - @Override - public T invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, BaseServerResponseException { - EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType); - IParser parser = respType.newParser(myContext); - return parser.parseResource(myType, theResponseReader); - } - } - private final class BundleResponseHandler implements IClientResponseHandler { private Class myType; @@ -297,8 +277,7 @@ public class GenericClient extends BaseClient implements IGenericClient { } @Override - public Bundle invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, - BaseServerResponseException { + public Bundle invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, BaseServerResponseException { EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType); if (respType == null) { throw NonFhirResponseException.newInstance(theResponseStatusCode, theResponseMimeType, theResponseReader); @@ -312,9 +291,9 @@ public class GenericClient extends BaseClient implements IGenericClient { private List myCriterion = new ArrayList(); private List myInclude = new ArrayList(); - private boolean myLogRequestAndResponse; private EncodingEnum myParamEncoding; private Integer myParamLimit; + private boolean myQueryLogRequestAndResponse; private String myResourceName; private Class myResourceType; private List mySort = new ArrayList(); @@ -329,6 +308,13 @@ public class GenericClient extends BaseClient implements IGenericClient { myResourceName = theResourceName; } + private void addParam(Map> params, String parameterName, String parameterValue) { + if (!params.containsKey(parameterName)) { + params.put(parameterName, new ArrayList()); + } + params.get(parameterName).add(parameterValue); + } + @Override public IQuery and(ICriterion theCriterion) { myCriterion.add((ICriterionInternal) theCriterion); @@ -337,7 +323,7 @@ public class GenericClient extends BaseClient implements IGenericClient { @Override public IQuery andLogRequestAndResponse(boolean theLogRequestAndResponse) { - myLogRequestAndResponse = theLogRequestAndResponse; + myQueryLogRequestAndResponse = theLogRequestAndResponse; return this; } @@ -392,7 +378,7 @@ public class GenericClient extends BaseClient implements IGenericClient { BundleResponseHandler binding = new BundleResponseHandler(myResourceType); - Bundle resp = invokeClient(binding, invocation, myLogRequestAndResponse); + Bundle resp = invokeClient(binding, invocation, myQueryLogRequestAndResponse || myLogRequestAndResponse); return resp; } @@ -413,6 +399,12 @@ public class GenericClient extends BaseClient implements IGenericClient { return this; } + @Override + public IQuery prettyPrint() { + setPrettyPrint(true); + return this; + } + @Override public ISort sort() { SortInternal retVal = new SortInternal(this); @@ -426,19 +418,20 @@ public class GenericClient extends BaseClient implements IGenericClient { return this; } - private void addParam(Map> params, String parameterName, String parameterValue) { - if (!params.containsKey(parameterName)) { - params.put(parameterName, new ArrayList()); - } - params.get(parameterName).add(parameterValue); + } + + private final class OutcomeResponseHandler implements IClientResponseHandler { + private final String myResourceName; + + private OutcomeResponseHandler(String theResourceName) { + myResourceName = theResourceName; } @Override - public IQuery prettyPrint() { - setPrettyPrint(true); - return this; + public MethodOutcome invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, BaseServerResponseException { + MethodOutcome response = BaseOutcomeReturningMethodBinding.process2xxResponse(myContext, myResourceName, theResponseStatusCode, theResponseMimeType, theResponseReader, theHeaders); + return response; } - } private class QueryInternal implements IUntypedQuery { @@ -455,6 +448,22 @@ public class GenericClient extends BaseClient implements IGenericClient { } + private final class ResourceResponseHandler implements IClientResponseHandler { + + private Class myType; + + public ResourceResponseHandler(Class theType) { + myType = theType; + } + + @Override + public T invokeClient(String theResponseMimeType, Reader theResponseReader, int theResponseStatusCode, Map> theHeaders) throws IOException, BaseServerResponseException { + EncodingEnum respType = EncodingEnum.forContentType(theResponseMimeType); + IParser parser = respType.newParser(myContext); + return parser.parseResource(myType, theResponseReader); + } + } + private class SortInternal implements ISort { private ForInternal myFor; diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java index 543fb101c02..e3e63f0c914 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/client/IGenericClient.java @@ -184,4 +184,13 @@ public interface IGenericClient { */ T vread(Class theType, String theId, String theVersionId); + /** + * If set to true, the client will log all requests and all responses. This + * is probably not a good production setting since it will result in a lot of extra logging, but + * it can be useful for troubleshooting. + * + * @param theLogRequestAndResponse Should requests and responses be logged + */ + void setLogRequestAndResponse(boolean theLogRequestAndResponse); + } diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/ReferenceParam.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/ReferenceParam.java index 2d7be146972..d9b326597af 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/ReferenceParam.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/gclient/ReferenceParam.java @@ -45,7 +45,7 @@ public class ReferenceParam implements IParam { * the logical ID or the absolute URL of the resource) */ public ICriterion hasId(IdDt theId) { - return new StringCriterion(getParamName(), theId.getValueAsString()); + return new StringCriterion(getParamName(), theId.getValue()); } /** diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java index 212c8af3246..a53510ead87 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/method/BaseOutcomeReturningMethodBinding.java @@ -420,15 +420,20 @@ public abstract class BaseOutcomeReturningMethodBinding extends BaseMethodBindin } protected static void parseContentLocation(MethodOutcome theOutcomeToPopulate, String theResourceName, String theLocationHeader) { + if (StringUtils.isBlank(theLocationHeader)) { + return; + } + + theOutcomeToPopulate.setId(new IdDt(theLocationHeader)); + String resourceNamePart = "/" + theResourceName + "/"; int resourceIndex = theLocationHeader.lastIndexOf(resourceNamePart); if (resourceIndex > -1) { int idIndexStart = resourceIndex + resourceNamePart.length(); int idIndexEnd = theLocationHeader.indexOf('/', idIndexStart); if (idIndexEnd == -1) { - theOutcomeToPopulate.setId(new IdDt(theLocationHeader.substring(idIndexStart))); + // nothing } else { - theOutcomeToPopulate.setId(new IdDt(theLocationHeader.substring(idIndexStart, idIndexEnd))); String versionIdPart = "/_history/"; int historyIdStart = theLocationHeader.indexOf(versionIdPart, idIndexEnd); if (historyIdStart != -1) { diff --git a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java index 9da378f65d7..0c343c8b1af 100644 --- a/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java +++ b/hapi-fhir-base/src/main/java/ca/uhn/fhir/rest/server/RestfulServer.java @@ -471,9 +471,9 @@ public class RestfulServer extends HttpServlet { StringBuffer requestUrl = theRequest.getRequestURL(); String servletContextPath = ""; if (theRequest.getServletContext() != null) { - servletContextPath = StringUtils.defaultIfBlank(theRequest.getServletContext().getContextPath(), servletPath); - } else { - servletContextPath = servletPath; + servletContextPath = StringUtils.defaultString(theRequest.getServletContext().getContextPath()); +// } else { + //servletContextPath = servletPath; } if (ourLog.isTraceEnabled()) { diff --git a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java index bb73099cf3a..5b90a61695f 100644 --- a/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java +++ b/hapi-fhir-base/src/test/java/ca/uhn/fhir/rest/client/ClientTest.java @@ -1,8 +1,11 @@ package ca.uhn.fhir.rest.client; -import static org.hamcrest.Matchers.*; -import static org.junit.Assert.*; -import static org.mockito.Mockito.*; +import static org.hamcrest.Matchers.containsString; +import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; +import static org.junit.Assert.fail; +import static org.mockito.Mockito.mock; +import static org.mockito.Mockito.when; import java.io.InputStream; import java.io.StringReader; @@ -104,7 +107,7 @@ public class ClientTest { assertEquals(HttpPost.class, capt.getValue().getClass()); HttpPost post = (HttpPost) capt.getValue(); assertThat(IOUtils.toString(post.getEntity().getContent()), StringContains.containsString(" - - - - - - - + - + + - - - - - - - + + - + + - - + + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/hapi-fhir-jpaserver-base/.project b/hapi-fhir-jpaserver-base/.project index afe6dcac996..33e676d4dbd 100644 --- a/hapi-fhir-jpaserver-base/.project +++ b/hapi-fhir-jpaserver-base/.project @@ -1,15 +1,24 @@ + - hapi-fhir-jpaserver-base - NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - hapi-fhir-base - - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.jdt.core.javanature - - \ No newline at end of file + hapi-fhir-jpaserver-base + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + hapi-fhir-base + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/hapi-fhir-jpaserver-base/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-jpaserver-base/.settings/org.eclipse.core.resources.prefs index 99f26c0203a..29abf999564 100644 --- a/hapi-fhir-jpaserver-base/.settings/org.eclipse.core.resources.prefs +++ b/hapi-fhir-jpaserver-base/.settings/org.eclipse.core.resources.prefs @@ -1,2 +1,6 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 encoding/=UTF-8 diff --git a/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs index d4d938284c8..69c31cd493c 100644 --- a/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-fhir-jpaserver-base/.settings/org.eclipse.jdt.core.prefs @@ -1,8 +1,8 @@ -#Sat May 03 09:10:27 MST 2014 -org.eclipse.jdt.core.compiler.problem.enumIdentifier=error -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 eclipse.preferences.version=1 org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 org.eclipse.jdt.core.compiler.problem.assertIdentifier=error -org.eclipse.jdt.core.compiler.source=1.7 -org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/hapi-fhir-jpaserver-base/.settings/org.eclipse.m2e.core.prefs b/hapi-fhir-jpaserver-base/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-fhir-jpaserver-base/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-jpaserver-base/pom.xml b/hapi-fhir-jpaserver-base/pom.xml index bed747631dd..67b66ee9a88 100644 --- a/hapi-fhir-jpaserver-base/pom.xml +++ b/hapi-fhir-jpaserver-base/pom.xml @@ -146,7 +146,8 @@ 10.10.2.0 14.0.1 1.3 - 4.3.5.Final + + 4.2.12.Final 5.1.0.Final 9.1.1.v20140108 1.9.5 @@ -161,8 +162,8 @@ org.apache.maven.plugins maven-compiler-plugin - 1.7 - 1.7 + 1.6 + 1.6 @@ -177,6 +178,13 @@ SCRIPT false + + + org.hibernate + hibernate-core + ${hibernate_version} + + o10g diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java index 75e06bbc217..00035048f77 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/BaseFhirDao.java @@ -77,7 +77,6 @@ public abstract class BaseFhirDao { } entity.setVersion(entity.getVersion() + 1); - theResource.setId(new IdDt(entity.getResourceType(), entity.getId().toString(), Long.toString(entity.getVersion()))); final List stringParams = extractSearchParamStrings(entity, theResource); final List tokenParams = extractSearchParamTokens(entity, theResource); @@ -140,6 +139,9 @@ public abstract class BaseFhirDao { myEntityManager.persist(next); } + myEntityManager.flush(); + theResource.setId(new IdDt(entity.getResourceType(), entity.getId().toString(), Long.toString(entity.getVersion()))); + return entity; } @@ -175,7 +177,7 @@ public abstract class BaseFhirDao { String typeString = nextValue.getResourceId().getResourceType(); if (isBlank(typeString)) { - continue; + throw new InvalidRequestException("Invalid resource reference found at path[" + nextPath + "] - Does not contain resource type - " + nextValue.getReference().getValue()); } Class type = getContext().getResourceDefinition(typeString).getImplementingClass(); String id = nextValue.getResourceId().getUnqualifiedId(); @@ -344,7 +346,7 @@ public abstract class BaseFhirDao { retVal.add(nextEntity); } else { if (nextObject instanceof HumanNameDt) { - ArrayList allNames = new ArrayList<>(); + ArrayList allNames = new ArrayList(); HumanNameDt nextHumanName = (HumanNameDt) nextObject; allNames.addAll(nextHumanName.getFamily()); allNames.addAll(nextHumanName.getGiven()); @@ -357,7 +359,7 @@ public abstract class BaseFhirDao { retVal.add(nextEntity); } } else if (nextObject instanceof AddressDt) { - ArrayList allNames = new ArrayList<>(); + ArrayList allNames = new ArrayList(); AddressDt nextAddress = (AddressDt) nextObject; allNames.addAll(nextAddress.getLine()); allNames.add(nextAddress.getCity()); @@ -460,7 +462,7 @@ public abstract class BaseFhirDao { protected IFhirResourceDao getDao(Class theType) { if (myResourceTypeToDao == null) { - myResourceTypeToDao = new HashMap<>(); + myResourceTypeToDao = new HashMap, IFhirResourceDao>(); for (IFhirResourceDao next : myResourceDaos) { myResourceTypeToDao.put(next.getResourceType(), next); } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java index e4e366ed9b2..9ad6a0c9ac3 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirResourceDao.java @@ -71,7 +71,8 @@ public class FhirResourceDao extends BaseFhirDao implements private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirResourceDao.class); - @PersistenceContext(name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT") + // name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT" + @PersistenceContext() private EntityManager myEntityManager; @Autowired @@ -97,12 +98,12 @@ public class FhirResourceDao extends BaseFhirDao implements // ourLog.info("Saving links: {}", links); - TransactionTemplate template = new TransactionTemplate(myPlatformTransactionManager); - template.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRES_NEW); - template.setReadOnly(false); - template.execute(new TransactionCallback() { - @Override - public ResourceTable doInTransaction(TransactionStatus theStatus) { +// TransactionTemplate template = new TransactionTemplate(myPlatformTransactionManager); +// template.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRES_NEW); +// template.setReadOnly(false); +// template.execute(new TransactionCallback() { +// @Override +// public ResourceTable doInTransaction(TransactionStatus theStatus) { // myEntityManager.persist(entity); // for (ResourceIndexedSearchParamString next : stringParams) { // myEntityManager.persist(next); @@ -120,9 +121,9 @@ public class FhirResourceDao extends BaseFhirDao implements // myEntityManager.persist(next); // } updateEntity(theResource, entity,false); - return entity; - } - }); +// return entity; +// } +// }); MethodOutcome outcome = toMethodOutcome(entity); return outcome; @@ -163,7 +164,7 @@ public class FhirResourceDao extends BaseFhirDao implements } @PostConstruct - public void postConstruct() throws Exception { + public void postConstruct() { myResourceName = getContext().getResourceDefinition(myResourceType).getName(); } @@ -195,7 +196,7 @@ public class FhirResourceDao extends BaseFhirDao implements } else { pids = searchForIdsWithAndOr(theParams); if (pids.isEmpty()) { - return new ArrayList<>(); + return new ArrayList(); } } @@ -210,7 +211,7 @@ public class FhirResourceDao extends BaseFhirDao implements } TypedQuery q = myEntityManager.createQuery(cq); - List retVal = new ArrayList<>(); + List retVal = new ArrayList(); for (ResourceTable next : q.getResultList()) { T resource = toResource(next); retVal.add(resource); @@ -489,8 +490,14 @@ public class FhirResourceDao extends BaseFhirDao implements if (params instanceof ReferenceParam) { ReferenceParam ref = (ReferenceParam) params; + String resourceId = ref.getValueAsQueryToken(); + if (resourceId.contains("/")) { + IdDt dt = new IdDt(resourceId); + resourceId = dt.getUnqualifiedId(); + } + if (isBlank(ref.getChain())) { - Long targetPid = Long.valueOf(ref.getValueAsQueryToken()); + Long targetPid = Long.valueOf(resourceId); ourLog.info("Searching for resource link with target PID: {}", targetPid); Predicate eq = builder.equal(from.get("myTargetResourcePid"), targetPid); codePredicates.add(eq); @@ -505,7 +512,7 @@ public class FhirResourceDao extends BaseFhirDao implements RuntimeChildResourceDefinition resDef = (RuntimeChildResourceDefinition) def; resourceTypes = resDef.getResourceTypes(); } else { - resourceTypes = new ArrayList<>(); + resourceTypes = new ArrayList>(); RuntimeResourceDefinition resDef = getContext().getResourceDefinition(ref.getResourceType()); resourceTypes.add(resDef.getImplementingClass()); } @@ -522,7 +529,7 @@ public class FhirResourceDao extends BaseFhirDao implements continue; } - IQueryParameterType chainValue = toParameterType(param.getParamType(), ref.getValueAsQueryToken()); + IQueryParameterType chainValue = toParameterType(param.getParamType(), resourceId); Set pids = dao.searchForIds(ref.getChain(), chainValue); if (pids.isEmpty()) { continue; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java index 1450e0325f8..b79e4a747ff 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/dao/FhirSystemDao.java @@ -22,7 +22,8 @@ import ca.uhn.fhir.util.FhirTerser; public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(FhirSystemDao.class); - @PersistenceContext(name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT") + //name = "FHIR_UT", type = PersistenceContextType.TRANSACTION, unitName = "FHIR_UT" + @PersistenceContext() private EntityManager myEntityManager; private FhirContext myContext = new FhirContext(); @@ -34,8 +35,8 @@ public class FhirSystemDao extends BaseFhirDao implements IFhirSystemDao { FhirTerser terser = myContext.newTerser(); - Map idConversions = new HashMap<>(); - List persistedResources = new ArrayList<>(); + Map idConversions = new HashMap(); + List persistedResources = new ArrayList(); for (IResource nextResource : theResources) { IdDt nextId = nextResource.getId(); if (nextId == null) { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTable.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTable.java index ea337e968e0..0e347b9e9ec 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTable.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTable.java @@ -51,7 +51,7 @@ public class ResourceHistoryTable extends BaseHasResource implements Serializabl public Collection getTags() { if (myTags == null) { - myTags = new ArrayList<>(); + myTags = new ArrayList(); } return myTags; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTag.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTag.java index 1435af92d22..3743c23899a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTag.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceHistoryTag.java @@ -3,7 +3,6 @@ package ca.uhn.fhir.jpa.entity; import java.io.Serializable; import javax.persistence.Entity; -import javax.persistence.ForeignKey; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; import javax.persistence.Id; @@ -27,8 +26,7 @@ public class ResourceHistoryTag extends BaseTag implements Serializable { @JoinColumn(name="RES_TYPE", referencedColumnName="RES_TYPE"), @JoinColumn(name="PID", referencedColumnName="PID"), @JoinColumn(name="VERSION", referencedColumnName="VERSION") - }, foreignKey=@ForeignKey(name="FK_HT_RT")) - @org.hibernate.annotations.ForeignKey(name="FK_HT_RT") + }/*, foreignKey=@ForeignKey(name="FK_HT_RT")*/) private ResourceHistoryTable myResourceHistory; public ResourceHistoryTag() { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java index e1be834c1ca..c65789704f0 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamDate.java @@ -9,9 +9,8 @@ import javax.persistence.Temporal; import javax.persistence.TemporalType; @Entity -@Table(name = "HFJ_SPIDX_DATE") -@org.hibernate.annotations.Table(appliesTo="HFJ_SPIDX_DATE",indexes= { - @org.hibernate.annotations.Index(name="IDX_SP_DATE", columnNames= {"SP_VALUE_LOW","SP_VALUE_HIGH"})}) +@Table(name = "HFJ_SPIDX_DATE" /*, indexes= {@Index(name="IDX_SP_DATE", columnList= "SP_VALUE_LOW,SP_VALUE_HIGH")}*/) +@org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_DATE", indexes= {@org.hibernate.annotations.Index(name="IDX_SP_DATE", columnNames= {"SP_VALUE_LOW","SP_VALUE_HIGH"})}) public class ResourceIndexedSearchParamDate extends BaseResourceIndexedSearchParam { private static final long serialVersionUID = 1L; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java index 931b61e8aa4..13a22f4970d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamNumber.java @@ -4,13 +4,11 @@ import java.math.BigDecimal; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Index; import javax.persistence.Table; @Entity -@Table(name = "HFJ_SPIDX_NUMBER", indexes= {@Index(name="IDX_SP_NUMBER", columnList="SP_VALUE")}) -@org.hibernate.annotations.Table(appliesTo="HFJ_SPIDX_NUMBER",indexes= { - @org.hibernate.annotations.Index(name="IDX_SP_NUMBER", columnNames= {"SP_VALUE"})}) +@Table(name = "HFJ_SPIDX_NUMBER" /*, indexes= {@Index(name="IDX_SP_NUMBER", columnList="SP_VALUE")}*/ ) +@org.hibernate.annotations.Table(appliesTo = "HFJ_SPIDX_NUMBER", indexes= {@org.hibernate.annotations.Index(name="IDX_SP_NUMBER", columnNames= {"SP_VALUE"})}) public class ResourceIndexedSearchParamNumber extends BaseResourceIndexedSearchParam { private static final long serialVersionUID = 1L; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java index b7db57e3f08..d932f035cc2 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamString.java @@ -2,11 +2,10 @@ package ca.uhn.fhir.jpa.entity; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Index; import javax.persistence.Table; @Entity -@Table(name = "HFJ_SPIDX_STRING", indexes= {@Index(name="IDX_SP_STRING", columnList="SP_VALUE_NORMALIZED")}) +@Table(name = "HFJ_SPIDX_STRING"/*, indexes= {@Index(name="IDX_SP_STRING", columnList="SP_VALUE_NORMALIZED")}*/) @org.hibernate.annotations.Table(appliesTo="HFJ_SPIDX_STRING",indexes= { @org.hibernate.annotations.Index(name="IDX_SP_STRING", columnNames= {"SP_VALUE_NORMALIZED"})}) public class ResourceIndexedSearchParamString extends BaseResourceIndexedSearchParam { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java index a6b97a122db..a52f412ebf1 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceIndexedSearchParamToken.java @@ -2,13 +2,12 @@ package ca.uhn.fhir.jpa.entity; import javax.persistence.Column; import javax.persistence.Entity; -import javax.persistence.Index; import javax.persistence.Table; @Entity -@Table(name = "HFJ_SPIDX_TOKEN", indexes = { @Index(name = "IDX_SP_TOKEN", columnList = "SP_SYSTEM,SP_VALUE") }) -//@org.hibernate.annotations.Table(appliesTo="HFJ_SPIDX_TOKEN", indexes= { -// @org.hibernate.annotations.Index(name="IDX_SP_TOKEN", columnNames= {"SP_SYSTEM","SP_VALUE"})}) +@Table(name = "HFJ_SPIDX_TOKEN" /*, indexes = { @Index(name = "IDX_SP_TOKEN", columnList = "SP_SYSTEM,SP_VALUE") }*/) +@org.hibernate.annotations.Table(appliesTo="HFJ_SPIDX_TOKEN", indexes= { + @org.hibernate.annotations.Index(name="IDX_SP_TOKEN", columnNames= {"SP_SYSTEM","SP_VALUE"})}) public class ResourceIndexedSearchParamToken extends BaseResourceIndexedSearchParam { private static final long serialVersionUID = 1L; diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceLink.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceLink.java index 33ec3be5c25..7513ff2581a 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceLink.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceLink.java @@ -14,7 +14,7 @@ import javax.persistence.Table; import org.apache.commons.lang3.Validate; @Entity -@Table(name = "HFJ_RES_LINK") +@Table(name = "HFJ_RES_LINK"/*, indexes= {@Index(name="IDX_RL_TPATHRES", columnList= "SRC_PATH,TARGET_RESOURCE_ID")}*/) @org.hibernate.annotations.Table(appliesTo="HFJ_RES_LINK",indexes= { @org.hibernate.annotations.Index(name="IDX_RL_TPATHRES", columnNames= {"SRC_PATH","TARGET_RESOURCE_ID"})}) public class ResourceLink implements Serializable { diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java index c5e2e55decd..718cba0e59d 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/entity/ResourceTable.java @@ -94,35 +94,35 @@ public class ResourceTable extends BaseHasResource implements Serializable { public Collection getParamsDate() { if (myParamsDate == null) { - myParamsDate = new ArrayList<>(); + myParamsDate = new ArrayList(); } return myParamsDate; } public Collection getParamsNumber() { if (myParamsNumber == null) { - myParamsNumber = new ArrayList<>(); + myParamsNumber = new ArrayList(); } return myParamsNumber; } public Collection getParamsString() { if (myParamsString == null) { - myParamsString = new ArrayList<>(); + myParamsString = new ArrayList(); } return myParamsString; } public Collection getParamsToken() { if (myParamsToken == null) { - myParamsToken = new ArrayList<>(); + myParamsToken = new ArrayList(); } return myParamsToken; } public Collection getResourceLinks() { if (myResourceLinks == null) { - myResourceLinks = new ArrayList<>(); + myResourceLinks = new ArrayList(); } return myResourceLinks; } @@ -133,7 +133,7 @@ public class ResourceTable extends BaseHasResource implements Serializable { public Collection getTags() { if (myTags == null) { - myTags = new ArrayList<>(); + myTags = new ArrayList(); } return myTags; } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProvider.java similarity index 83% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java rename to hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProvider.java index 14cc914998c..a18101228ea 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/BaseJpaResourceProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaResourceProvider.java @@ -20,11 +20,19 @@ import ca.uhn.fhir.rest.annotation.Update; import ca.uhn.fhir.rest.api.MethodOutcome; import ca.uhn.fhir.rest.server.IResourceProvider; -public abstract class BaseJpaResourceProvider implements IResourceProvider { +public class JpaResourceProvider implements IResourceProvider { private FhirContext myContext=new FhirContext(); private IFhirResourceDao myDao; + public JpaResourceProvider() { + //nothing + } + + public JpaResourceProvider(IFhirResourceDao theDao) { + myDao=theDao; + } + @Create public MethodOutcome create(@ResourceParam T theResource) { return myDao.create(theResource); @@ -63,4 +71,9 @@ public abstract class BaseJpaResourceProvider implements IR return myDao.update(theResource, theId); } + @Override + public Class getResourceType() { + return myDao.getResourceType(); + } + } diff --git a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/SystemProvider.java b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaSystemProvider.java similarity index 79% rename from hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/SystemProvider.java rename to hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaSystemProvider.java index f907f9ceaa3..0dab636f5af 100644 --- a/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/SystemProvider.java +++ b/hapi-fhir-jpaserver-base/src/main/java/ca/uhn/fhir/jpa/provider/JpaSystemProvider.java @@ -9,10 +9,19 @@ import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.rest.annotation.Transaction; import ca.uhn.fhir.rest.annotation.TransactionParam; -public class SystemProvider { +public class JpaSystemProvider { private IFhirSystemDao myDao; + public JpaSystemProvider() { + //nothing + } + + public JpaSystemProvider(IFhirSystemDao theDao) { + myDao=theDao; + } + + @Required public void setDao(IFhirSystemDao theDao) { myDao = theDao; diff --git a/hapi-fhir-jpaserver-base/src/main/resources/logback.xml b/hapi-fhir-jpaserver-base/src/main/resources/logback.xml deleted file mode 100644 index 74da9503c69..00000000000 --- a/hapi-fhir-jpaserver-base/src/main/resources/logback.xml +++ /dev/null @@ -1,99 +0,0 @@ - - - - /var/log/glassfish/svcret/svcret-ejb.log - - INFO - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n - - - /var/log/glassfish/svcret/svcret-ejb.log_%d{yyyy-MM-dd'T'HH'-00-00'} - - - - - /var/log/glassfish/svcret/svcret-error.log - - ERROR - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n - - - /var/log/glassfish/svcret/svcret-error-%i.log - 1 - 10 - - - 5MB - - - - - /var/log/glassfish/svcret/svcret-debug.log - - DEBUG - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n - - - /var/log/glassfish/svcret/svcret-debug-%i.log - 1 - 10 - - - 5MB - - - - - /var/log/glassfish/svcret/svcret-admin.log - - DEBUG - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n - - - /var/log/glassfish/svcret/svcret-admin.log_%d{yyyy-MM-dd'T'HH'-00-00'} - - - - - - WARN - - - %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java index 0b1713fac55..75e480eb2f9 100644 --- a/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java +++ b/hapi-fhir-jpaserver-base/src/test/java/ca/uhn/fhir/jpa/dao/FhirResourceDaoTest.java @@ -220,7 +220,7 @@ public class FhirResourceDaoTest { ourPatientDao.create(patient); } - Map params = new HashMap<>(); + Map params = new HashMap(); List patients = ourPatientDao.search(params); assertTrue(patients.size() >= 2); } @@ -241,19 +241,19 @@ public class FhirResourceDaoTest { ourPatientDao.create(patient); } - Map params = new HashMap<>(); + Map params = new HashMap(); params.put(Patient.SP_FAMILY, new StringDt("testSearchNameParam01Fam")); List patients = ourPatientDao.search(params); assertEquals(1, patients.size()); assertEquals(id1.getUnqualifiedId(), patients.get(0).getId().getUnqualifiedId()); - params = new HashMap<>(); + params = new HashMap(); params.put(Patient.SP_FAMILY, new StringDt("testSearchNameParam01Giv")); patients = ourPatientDao.search(params); assertEquals(1, patients.size()); assertEquals(id1.getUnqualifiedId(), patients.get(0).getId().getUnqualifiedId()); - params = new HashMap<>(); + params = new HashMap(); params.put(Patient.SP_FAMILY, new StringDt("testSearchNameParam01Foo")); patients = ourPatientDao.search(params); assertEquals(0, patients.size()); @@ -368,7 +368,7 @@ public class FhirResourceDaoTest { ourPatientDao.create(patient); } - Map params = new HashMap<>(); + Map params = new HashMap(); params.put(Patient.SP_FAMILY, new StringDt("Tester_testSearchStringParam")); List patients = ourPatientDao.search(params); assertEquals(2, patients.size()); @@ -394,7 +394,7 @@ public class FhirResourceDaoTest { ourPatientDao.create(patient); } - Map params = new HashMap<>(); + Map params = new HashMap(); params.put(Patient.SP_FAMILY, new StringDt("testSearchStringParamWithNonNormalized_hora")); List patients = ourPatientDao.search(params); assertEquals(2, patients.size()); diff --git a/hapi-fhir-jpaserver-base/src/test/resources/logback.xml b/hapi-fhir-jpaserver-base/src/test/resources/logback.xml new file mode 100644 index 00000000000..8da72a0e285 --- /dev/null +++ b/hapi-fhir-jpaserver-base/src/test/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + INFO + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-test/.classpath b/hapi-fhir-jpaserver-test/.classpath index dacfbb448b8..35fc3e5daec 100644 --- a/hapi-fhir-jpaserver-test/.classpath +++ b/hapi-fhir-jpaserver-test/.classpath @@ -1,166 +1,33 @@ - + - - - - + - + + - + - + + - - - - - - - + - + - - + - + - + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + diff --git a/hapi-fhir-jpaserver-test/.classpath_ b/hapi-fhir-jpaserver-test/.classpath_ new file mode 100644 index 00000000000..dacfbb448b8 --- /dev/null +++ b/hapi-fhir-jpaserver-test/.classpath_ @@ -0,0 +1,166 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-jpaserver-test/.project b/hapi-fhir-jpaserver-test/.project index a1c894dfada..99e5f14f0e1 100644 --- a/hapi-fhir-jpaserver-test/.project +++ b/hapi-fhir-jpaserver-test/.project @@ -1,16 +1,25 @@ + - hapi-fhir-jpaserver-test - NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. - - hapi-fhir-base - hapi-fhir-jpaserver-base - - - - org.eclipse.jdt.core.javabuilder - - - - org.eclipse.jdt.core.javanature - - \ No newline at end of file + hapi-fhir-jpaserver-test + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + hapi-fhir-base + hapi-fhir-jpaserver-base + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.m2e.core.maven2Nature + org.eclipse.jdt.core.javanature + + diff --git a/hapi-fhir-jpaserver-test/.project_ b/hapi-fhir-jpaserver-test/.project_ new file mode 100644 index 00000000000..a1c894dfada --- /dev/null +++ b/hapi-fhir-jpaserver-test/.project_ @@ -0,0 +1,16 @@ + + hapi-fhir-jpaserver-test + NO_M2ECLIPSE_SUPPORT: Project files created with the maven-eclipse-plugin are not supported in M2Eclipse. + + hapi-fhir-base + hapi-fhir-jpaserver-base + + + + org.eclipse.jdt.core.javabuilder + + + + org.eclipse.jdt.core.javanature + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-test/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-jpaserver-test/.settings/org.eclipse.core.resources.prefs index adbffdfec47..62804f2210d 100644 --- a/hapi-fhir-jpaserver-test/.settings/org.eclipse.core.resources.prefs +++ b/hapi-fhir-jpaserver-test/.settings/org.eclipse.core.resources.prefs @@ -1,2 +1,7 @@ eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 encoding//src/test/java/ca/uhn/fhir/jpa/test/Upload.java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/hapi-fhir-jpaserver-test/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-jpaserver-test/.settings/org.eclipse.jdt.core.prefs index a09c7a14cc7..ec4300d5d09 100644 --- a/hapi-fhir-jpaserver-test/.settings/org.eclipse.jdt.core.prefs +++ b/hapi-fhir-jpaserver-test/.settings/org.eclipse.jdt.core.prefs @@ -1,5 +1,5 @@ -#Sat May 03 16:44:33 MST 2014 -org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 eclipse.preferences.version=1 -org.eclipse.jdt.core.compiler.source=1.7 +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7 org.eclipse.jdt.core.compiler.compliance=1.7 +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.7 diff --git a/hapi-fhir-jpaserver-test/.settings/org.eclipse.m2e.core.prefs b/hapi-fhir-jpaserver-test/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-fhir-jpaserver-test/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-jpaserver-test/pom.xml b/hapi-fhir-jpaserver-test/pom.xml index 9ec0a45a9f5..da5490ba767 100644 --- a/hapi-fhir-jpaserver-test/pom.xml +++ b/hapi-fhir-jpaserver-test/pom.xml @@ -8,7 +8,6 @@ ../pom.xml - ca.uhn.hapi.fhir hapi-fhir-jpaserver-test jar @@ -25,6 +24,11 @@ thymeleaf 2.1.2.RELEASE + + ch.qos.logback + logback-classic + 1.1.1 + junit diff --git a/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java index f65a46fd1d6..548c6ad0714 100644 --- a/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java +++ b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/CompleteResourceProviderTest.java @@ -75,7 +75,7 @@ public class CompleteResourceProviderTest { Bundle actual = ourClient.search().forResource(Patient.class).where(Patient.IDENTIFIER.exactly().systemAndCode("urn:system", "testSearchByIdentifier01")).encodedJson().prettyPrint().execute(); assertEquals(1, actual.size()); - assertEquals(p1Id, actual.getEntries().get(0).getId()); + assertEquals(p1Id.getUnqualifiedId(), actual.getEntries().get(0).getId().getUnqualifiedId()); } @@ -88,30 +88,39 @@ public class CompleteResourceProviderTest { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); - p1.setManagingOrganization(new ResourceReferenceDt("Organization/o1id")); + p1.setManagingOrganization(new ResourceReferenceDt(o1id)); IdDt p1Id = ourClient.create(p1).getId(); //@formatter:off Bundle actual = ourClient.search() .forResource(Patient.class) - .where(Patient.PROVIDER.hasId(o1id)) - .encodedJson().prettyPrint().execute(); + .where(Patient.PROVIDER.hasId(o1id.getUnqualifiedId())) + .encodedJson().andLogRequestAndResponse(true).prettyPrint().execute(); //@formatter:on assertEquals(1, actual.size()); - assertEquals(p1Id, actual.getEntries().get(0).getId()); + assertEquals(p1Id.getUnqualifiedId(), actual.getEntries().get(0).getId().getUnqualifiedId()); + + //@formatter:off + actual = ourClient.search() + .forResource(Patient.class) + .where(Patient.PROVIDER.hasId(o1id.getValue())) + .encodedJson().andLogRequestAndResponse(true).prettyPrint().execute(); + //@formatter:on + assertEquals(1, actual.size()); + assertEquals(p1Id.getUnqualifiedId(), actual.getEntries().get(0).getId().getUnqualifiedId()); } - + @Test public void testInsertBadReference() { Patient p1 = new Patient(); p1.addIdentifier().setSystem("urn:system").setValue("testSearchByResourceChain01"); p1.addName().addFamily("testSearchByResourceChainFamily01").addGiven("testSearchByResourceChainGiven01"); p1.setManagingOrganization(new ResourceReferenceDt("Organization/132312323")); - + try { - ourClient.create(p1).getId(); - fail(); + ourClient.create(p1).getId(); + fail(); } catch (InvalidRequestException e) { assertThat(e.getMessage(), containsString("Organization/132312323")); } @@ -172,6 +181,7 @@ public class CompleteResourceProviderTest { ourCtx = restServer.getFhirContext(); ourClient = ourCtx.newRestfulGenericClient(serverBase); + ourClient.setLogRequestAndResponse(true); } } diff --git a/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/QuestionnaireResourceProvider.java b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/QuestionnaireResourceProvider.java index a5c21979360..496ccb887b4 100644 --- a/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/QuestionnaireResourceProvider.java +++ b/hapi-fhir-jpaserver-test/src/test/java/ca/uhn/fhir/jpa/test/QuestionnaireResourceProvider.java @@ -1,10 +1,10 @@ package ca.uhn.fhir.jpa.test; -import ca.uhn.fhir.jpa.provider.BaseJpaResourceProvider; +import ca.uhn.fhir.jpa.provider.JpaResourceProvider; import ca.uhn.fhir.model.api.IResource; import ca.uhn.fhir.model.dstu.resource.Questionnaire; -public class QuestionnaireResourceProvider extends BaseJpaResourceProvider { +public class QuestionnaireResourceProvider extends JpaResourceProvider { @Override public Class getResourceType() { diff --git a/hapi-fhir-jpaserver-test/src/test/resources/logback.xml b/hapi-fhir-jpaserver-test/src/test/resources/logback.xml new file mode 100644 index 00000000000..8da72a0e285 --- /dev/null +++ b/hapi-fhir-jpaserver-test/src/test/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + INFO + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.classpath b/hapi-fhir-jpaserver-uhnfhirtest/.classpath new file mode 100644 index 00000000000..ee3dce2b34a --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/.classpath @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.gitignore b/hapi-fhir-jpaserver-uhnfhirtest/.gitignore new file mode 100644 index 00000000000..25438761855 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/.gitignore @@ -0,0 +1,3 @@ +myUnitTestDB/ +target/ +/bin diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.project b/hapi-fhir-jpaserver-uhnfhirtest/.project new file mode 100644 index 00000000000..68a941de9c6 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/.project @@ -0,0 +1,23 @@ + + + hapi-fhir-jpaserver-uhnfhirtest + + + + + + org.eclipse.jdt.core.javabuilder + + + + + org.eclipse.m2e.core.maven2Builder + + + + + + org.eclipse.jdt.core.javanature + org.eclipse.m2e.core.maven2Nature + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.core.resources.prefs b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.core.resources.prefs new file mode 100644 index 00000000000..29abf999564 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.core.resources.prefs @@ -0,0 +1,6 @@ +eclipse.preferences.version=1 +encoding//src/main/java=UTF-8 +encoding//src/main/resources=UTF-8 +encoding//src/test/java=UTF-8 +encoding//src/test/resources=UTF-8 +encoding/=UTF-8 diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.jdt.core.prefs b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.jdt.core.prefs new file mode 100644 index 00000000000..69c31cd493c --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.jdt.core.prefs @@ -0,0 +1,8 @@ +eclipse.preferences.version=1 +org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled +org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6 +org.eclipse.jdt.core.compiler.compliance=1.6 +org.eclipse.jdt.core.compiler.problem.assertIdentifier=error +org.eclipse.jdt.core.compiler.problem.enumIdentifier=error +org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning +org.eclipse.jdt.core.compiler.source=1.6 diff --git a/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.m2e.core.prefs b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.m2e.core.prefs new file mode 100644 index 00000000000..f897a7f1cb2 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/.settings/org.eclipse.m2e.core.prefs @@ -0,0 +1,4 @@ +activeProfiles= +eclipse.preferences.version=1 +resolveWorkspaceProjects=true +version=1 diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml new file mode 100644 index 00000000000..a18598fcabc --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml @@ -0,0 +1,168 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.4-SNAPSHOT + ../pom.xml + + + hapi-fhir-jpaserver-uhnfhirtest + + HAPI FHIR JPA Server - Test Project + + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-base + 0.4-SNAPSHOT + + + org.thymeleaf + thymeleaf + 2.1.2.RELEASE + + + ch.qos.logback + logback-classic + 1.1.1 + + + com.google.guava + guava + 17.0 + + + + javax.servlet + javax.servlet-api + 3.0.1 + provided + + + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.6 + 1.6 + + + + + + + ca.uhn.hapi.fhir + hapi-tinder-plugin + 0.4-SNAPSHOT + + + buildclient + + generate-jparest-server + + + ca.uhn.test.jpasrv + + + + adversereaction + alert + allergyintolerance + appointmentresponse + appointment + availability + careplan + claim + composition + conceptmap + condition + conformance + coverage + deviceobservationreport + device + diagnosticorder + diagnosticreport + documentmanifest + documentreference + encounter + + familyhistory + geneexpression + geneticanalysis + group + gvfmeta + gvfvariant + imagingstudy + immunizationrecommendation + immunization + list + location + media + medicationadministration + medicationdispense + medicationprescription + medication + medicationstatement + messageheader + microarray + + observation + operationoutcome + orderresponse + order + organization + other + patient + + practitioner + procedure + profile + + + provenance + query + + questionnaire + relatedperson + remittance + + securityevent + + sequencinganalysis + sequencinglab + slot + specimen + substance + supply + + test + user + + valueset + + + + true + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + war + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/pom.xml.versionsBackup b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml.versionsBackup new file mode 100644 index 00000000000..59db081e89b --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/pom.xml.versionsBackup @@ -0,0 +1,98 @@ + + 4.0.0 + + + ca.uhn.hapi.fhir + hapi-fhir + 0.3-SNAPSHOT + ../pom.xml + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-test + jar + + HAPI FHIR JPA Server - Tester + + + + ca.uhn.hapi.fhir + hapi-fhir-jpaserver-base + 0.3-SNAPSHOT + + + + junit + junit + ${junit_version} + test + + + com.google.guava + guava + 17.0 + + + org.eclipse.jetty + jetty-servlets + ${jetty_version} + test + + + org.eclipse.jetty + jetty-servlet + ${jetty_version} + test + + + org.eclipse.jetty + jetty-server + ${jetty_version} + test + + + org.eclipse.jetty + jetty-servlet + ${jetty_version} + test + + + org.eclipse.jetty + jetty-util + ${jetty_version} + test + + + + + + + 4.11 + 9.1.1.v20140108 + + + + + + + org.apache.maven.plugins + maven-compiler-plugin + + 1.7 + 1.7 + + + + + + + org.apache.maven.plugins + maven-deploy-plugin + + true + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java new file mode 100644 index 00000000000..47d1763d489 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/java/ca/uhn/fhirtest/TestRestfulServer.java @@ -0,0 +1,51 @@ +package ca.uhn.fhirtest; + +import java.sql.DriverManager; +import java.sql.SQLException; +import java.util.Collection; + +import org.springframework.context.support.ClassPathXmlApplicationContext; + +import ca.uhn.fhir.jpa.dao.IFhirSystemDao; +import ca.uhn.fhir.jpa.provider.JpaSystemProvider; +import ca.uhn.fhir.rest.server.IResourceProvider; +import ca.uhn.fhir.rest.server.RestfulServer; + +public class TestRestfulServer extends RestfulServer { + + private static final long serialVersionUID = 1L; + + private ClassPathXmlApplicationContext myAppCtx; + private static final org.slf4j.Logger ourLog = org.slf4j.LoggerFactory.getLogger(TestRestfulServer.class); + + @Override + protected void initialize() { + super.initialize(); + + try { + DriverManager.getConnection("jdbc:derby:directory:" + System.getProperty("fhir.db.location") + ";create=true"); + } catch (Exception e) { + ourLog.info("Failed to create database: {}",e.getMessage()); + } + + myAppCtx = new ClassPathXmlApplicationContext("fhir-spring-uhnfhirtest-config.xml"); + + Collection beans = myAppCtx.getBeansOfType(IResourceProvider.class).values(); + for (IResourceProvider nextResourceProvider : beans) { + ourLog.info(" * Have resource provider for: {}", nextResourceProvider.getResourceType().getSimpleName()); + } + setResourceProviders(beans); + + IFhirSystemDao systemDao = myAppCtx.getBean(IFhirSystemDao.class); + JpaSystemProvider sp = new JpaSystemProvider(systemDao); + setPlainProviders(sp); + } + + @Override + public void destroy() { + super.destroy(); + + myAppCtx.close(); + } + +} diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/META-INF/fhirtest_persistence.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/META-INF/fhirtest_persistence.xml new file mode 100644 index 00000000000..82d9904d485 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/META-INF/fhirtest_persistence.xml @@ -0,0 +1,41 @@ + + + + + org.hibernate.ejb.HibernatePersistence + ca.uhn.fhir.jpa.entity.ResourceHistoryTable + ca.uhn.fhir.jpa.entity.ResourceHistoryTag + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken + ca.uhn.fhir.jpa.entity.ResourceLink + ca.uhn.fhir.jpa.entity.ResourceTable + ca.uhn.fhir.jpa.entity.ResourceTag + + true + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/fhir-spring-uhnfhirtest-config.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/fhir-spring-uhnfhirtest-config.xml new file mode 100644 index 00000000000..e828fbc77a7 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/fhir-spring-uhnfhirtest-config.xml @@ -0,0 +1,83 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/logback.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/logback.xml new file mode 100644 index 00000000000..8da72a0e285 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + INFO + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/web.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/web.xml new file mode 100644 index 00000000000..2f27c32d08c --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/web.xml @@ -0,0 +1,17 @@ + + + + + fhirServlet + ca.uhn.fhirtest.TestRestfulServer + 1 + + + + fhirServlet + /base/* + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/javaee_6.xsd b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/javaee_6.xsd new file mode 100644 index 00000000000..c34f199542b --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/javaee_6.xsd @@ -0,0 +1,2422 @@ + + + + + + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. + + The contents of this file are subject to the terms of either the + GNU General Public License Version 2 only ("GPL") or the Common + Development and Distribution License("CDDL") (collectively, the + "License"). You may not use this file except in compliance with + the License. You can obtain a copy of the License at + https://glassfish.dev.java.net/public/CDDL+GPL.html or + glassfish/bootstrap/legal/LICENSE.txt. See the License for the + specific language governing permissions and limitations under the + License. + + When distributing the software, include this License Header + Notice in each file and include the License file at + glassfish/bootstrap/legal/LICENSE.txt. Sun designates this + particular file as subject to the "Classpath" exception as + provided by Sun in the GPL Version 2 section of the License file + that accompanied this code. If applicable, add the following + below the License Header, with the fields enclosed by brackets [] + replaced by your own identifying information: + "Portions Copyrighted [year] [name of copyright owner]" + + Contributor(s): + + If you wish your version of this file to be governed by only the + CDDL or only the GPL Version 2, indicate your decision by adding + "[Contributor] elects to include this software in this + distribution under the [CDDL or GPL Version 2] license." If you + don't indicate a single choice of license, a recipient has the + option to distribute your version of this file under either the + CDDL, the GPL Version 2 or to extend the choice of license to its + licensees as provided above. However, if you add GPL Version 2 + code and therefore, elected the GPL Version 2 license, then the + option applies only if the new code is made subject to such + option by the copyright holder. + + + + + + + + The following definitions that appear in the common + shareable schema(s) of Java EE deployment descriptors should be + interpreted with respect to the context they are included: + + Deployment Component may indicate one of the following: + java ee application; + application client; + web application; + enterprise bean; + resource adapter; + + Deployment File may indicate one of the following: + ear file; + war file; + jar file; + rar file; + + + + + + + + + + + + + This group keeps the usage of the contained description related + elements consistent across Java EE deployment descriptors. + + All elements may occur multiple times with different languages, + to support localization of the content. + + + + + + + + + + + + + + + This group keeps the usage of the contained JNDI environment + reference elements consistent across Java EE deployment descriptors. + + + + + + + + + + + + + + + + + + + + + + + + This group collects elements that are common to most + JNDI resource elements. + + + + + + + + + + The JNDI name to be looked up to resolve a resource reference. + + + + + + + + + + + + This group collects elements that are common to all the + JNDI resource elements. It does not include the lookup-name + element, that is only applicable to some resource elements. + + + + + + + + + A product specific name that this resource should be + mapped to. The name of this resource, as defined by the + resource's name element or defaulted, is a name that is + local to the application component using the resource. + (It's a name in the JNDI java:comp/env namespace.) Many + application servers provide a way to map these local + names to names of resources known to the application + server. This mapped name is often a global JNDI name, + but may be a name of any form. + + Application servers are not required to support any + particular form or type of mapped name, nor the ability + to use mapped names. The mapped name is + product-dependent and often installation-dependent. No + use of a mapped name is portable. + + + + + + + + + + + + + + + + Configuration of a DataSource. + + + + + + + + + Description of this DataSource. + + + + + + + + + The name element specifies the JNDI name of the + data source being defined. + + + + + + + + + DataSource, XADataSource or ConnectionPoolDataSource + implementation class. + + + + + + + + + Database server name. + + + + + + + + + Port number where a server is listening for requests. + + + + + + + + + Name of a database on a server. + + + + + + + + url property is specified + along with other standard DataSource properties + such as serverName, databaseName + and portNumber, the more specific properties will + take precedence and url will be ignored. + + ]]> + + + + + + + + User name to use for connection authentication. + + + + + + + + + Password to use for connection authentication. + + + + + + + + + JDBC DataSource property. This may be a vendor-specific + property or a less commonly used DataSource property. + + + + + + + + + Sets the maximum time in seconds that this data source + will wait while attempting to connect to a database. + + + + + + + + + Set to false if connections should not participate in + transactions. + + + + + + + + + Isolation level for connections. + + + + + + + + + Number of connections that should be created when a + connection pool is initialized. + + + + + + + + + Maximum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + Minimum number of connections that should be concurrently + allocated for a connection pool. + + + + + + + + + The number of seconds that a physical connection should + remain unused in the pool before the connection is + closed for a connection pool. + + + + + + + + + The total number of statements that a connection pool + should keep open. + + + + + + + + + + + + + + + + The description type is used by a description element to + provide text describing the parent element. The elements + that use this type should include any information that the + Deployment Component's Deployment File file producer wants + to provide to the consumer of the Deployment Component's + Deployment File (i.e., to the Deployer). Typically, the + tools used by such a Deployment File consumer will display + the description when processing the parent element that + contains the description. + + The lang attribute defines the language that the + description is provided in. The default value is "en" (English). + + + + + + + + + + + + + + + This type defines a dewey decimal that is used + to describe versions of documents. + + + + + + + + + + + + + + + + Employee Self Service + + + The value of the xml:lang attribute is "en" (English) by default. + + ]]> + + + + + + + + + + + + + + + + EmployeeRecord + + ../products/product.jar#ProductEJB + + ]]> + + + + + + + + + + + + + + + The ejb-local-refType is used by ejb-local-ref elements for + the declaration of a reference to an enterprise bean's local + home or to the local business interface of a 3.0 bean. + The declaration consists of: + + - an optional description + - the EJB reference name used in the code of the Deployment + Component that's referencing the enterprise bean. + - the optional expected type of the referenced enterprise bean + - the optional expected local interface of the referenced + enterprise bean or the local business interface of the + referenced enterprise bean. + - the optional expected local home interface of the referenced + enterprise bean. Not applicable if this ejb-local-ref refers + to the local business interface of a 3.0 bean. + - optional ejb-link information, used to specify the + referenced enterprise bean + - optional elements to define injection of the named enterprise + bean into a component field or property. + + + + + + + + + + + + + + + + + + + + + + ejb/Payroll + + ]]> + + + + + + + + + + + + + + + The ejb-refType is used by ejb-ref elements for the + declaration of a reference to an enterprise bean's home or + to the remote business interface of a 3.0 bean. + The declaration consists of: + + - an optional description + - the EJB reference name used in the code of + the Deployment Component that's referencing the enterprise + bean. + - the optional expected type of the referenced enterprise bean + - the optional remote interface of the referenced enterprise bean + or the remote business interface of the referenced enterprise + bean + - the optional expected home interface of the referenced + enterprise bean. Not applicable if this ejb-ref + refers to the remote business interface of a 3.0 bean. + - optional ejb-link information, used to specify the + referenced enterprise bean + - optional elements to define injection of the named enterprise + bean into a component field or property + + + + + + + + + + + + + + + + + + + + + + + The ejb-ref-typeType contains the expected type of the + referenced enterprise bean. + + The ejb-ref-type designates a value + that must be one of the following: + + Entity + Session + + + + + + + + + + + + + + + + + + + This type is used to designate an empty + element when used. + + + + + + + + + + + + + + The env-entryType is used to declare an application's + environment entry. The declaration consists of an optional + description, the name of the environment entry, a type + (optional if the value is injected, otherwise required), and + an optional value. + + It also includes optional elements to define injection of + the named resource into fields or JavaBeans properties. + + If a value is not specified and injection is requested, + no injection will occur and no entry of the specified name + will be created. This allows an initial value to be + specified in the source code without being incorrectly + changed when no override has been specified. + + If a value is not specified and no injection is requested, + a value must be supplied during deployment. + + This type is used by env-entry elements. + + + + + + + + + minAmount + + ]]> + + + + + + + java.lang.Integer + + ]]> + + + + + + + 100.00 + + ]]> + + + + + + + + + + + + + + + java.lang.Boolean + java.lang.Class + com.example.Color + + ]]> + + + + + + + + + + + + + + + The elements that use this type designate the name of a + Java class or interface. The name is in the form of a + "binary name", as defined in the JLS. This is the form + of name used in Class.forName(). Tools that need the + canonical name (the name used in source code) will need + to convert this binary name to the canonical name. + + + + + + + + + + + + + + + + This type defines four different values which can designate + boolean values. This includes values yes and no which are + not designated by xsd:boolean + + + + + + + + + + + + + + + + + + + + + The icon type contains small-icon and large-icon elements + that specify the file names for small and large GIF, JPEG, + or PNG icon images used to represent the parent element in a + GUI tool. + + The xml:lang attribute defines the language that the + icon file names are provided in. Its value is "en" (English) + by default. + + + + + + + + employee-service-icon16x16.jpg + + ]]> + + + + + + + employee-service-icon32x32.jpg + + ]]> + + + + + + + + + + + + + + + + An injection target specifies a class and a name within + that class into which a resource should be injected. + + The injection target class specifies the fully qualified + class name that is the target of the injection. The + Java EE specifications describe which classes can be an + injection target. + + The injection target name specifies the target within + the specified class. The target is first looked for as a + JavaBeans property name. If not found, the target is + looked for as a field name. + + The specified resource will be injected into the target + during initialization of the class by either calling the + set method for the target property or by setting a value + into the named field. + + + + + + + + + + + + + + The following transaction isolation levels are allowed + (see documentation for the java.sql.Connection interface): + TRANSACTION_READ_UNCOMMITTED + TRANSACTION_READ_COMMITTED + TRANSACTION_REPEATABLE_READ + TRANSACTION_SERIALIZABLE + + + + + + + + + + + + + + + + + + + The java-identifierType defines a Java identifier. + The users of this type should further verify that + the content does not contain Java reserved keywords. + + + + + + + + + + + + + + + + + + This is a generic type that designates a Java primitive + type or a fully qualified name of a Java interface/type, + or an array of such types. + + + + + + + + + + + + + + + + + : + + Example: + + jdbc:mysql://localhost:3307/testdb + + ]]> + + + + + + + + + + + + + + + + + The jndi-nameType type designates a JNDI name in the + Deployment Component's environment and is relative to the + java:comp/env context. A JNDI name must be unique within the + Deployment Component. + + + + + + + + + + + + + + + com.aardvark.payroll.PayrollHome + + ]]> + + + + + + + + + + + + + + + The lifecycle-callback type specifies a method on a + class to be called when a lifecycle event occurs. + Note that each class may have only one lifecycle callback + method for any given event and that the method may not + be overloaded. + + If the lifefycle-callback-class element is missing then + the class defining the callback is assumed to be the + component class in scope at the place in the descriptor + in which the callback definition appears. + + + + + + + + + + + + + + + + + The listenerType indicates the deployment properties for a web + application listener bean. + + + + + + + + + + The listener-class element declares a class in the + application must be registered as a web + application listener bean. The value is the fully + qualified classname of the listener class. + + + + + + + + + + + + + + + + The localType defines the fully-qualified name of an + enterprise bean's local interface. + + + + + + + + + + + + + + + + The local-homeType defines the fully-qualified + name of an enterprise bean's local home interface. + + + + + + + + + + + + + + + + This type is a general type that can be used to declare + parameter/value lists. + + + + + + + + + + The param-name element contains the name of a + parameter. + + + + + + + + + The param-value element contains the value of a + parameter. + + + + + + + + + + + + + + + + The elements that use this type designate either a relative + path or an absolute path starting with a "/". + + In elements that specify a pathname to a file within the + same Deployment File, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the Deployment File's namespace. Absolute filenames (i.e., + those starting with "/") also specify names in the root of + the Deployment File's namespace. In general, relative names + are preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + + myPersistenceContext + + + + + myPersistenceContext + + PersistenceUnit1 + + Extended + + + ]]> + + + + + + + + + The persistence-context-ref-name element specifies + the name of a persistence context reference; its + value is the environment entry name used in + Deployment Component code. The name is a JNDI name + relative to the java:comp/env context. + + + + + + + + + The Application Assembler(or BeanProvider) may use the + following syntax to avoid the need to rename persistence + units to have unique names within a Java EE application. + + The Application Assembler specifies the pathname of the + root of the persistence.xml file for the referenced + persistence unit and appends the name of the persistence + unit separated from the pathname by #. The pathname is + relative to the referencing application component jar file. + In this manner, multiple persistence units with the same + persistence unit name may be uniquely identified when the + Application Assembler cannot change persistence unit names. + + + + + + + + + + Used to specify properties for the container or persistence + provider. Vendor-specific properties may be included in + the set of properties. Properties that are not recognized + by a vendor must be ignored. Entries that make use of the + namespace javax.persistence and its subnamespaces must not + be used for vendor-specific properties. The namespace + javax.persistence is reserved for use by the specification. + + + + + + + + + + + + + + + + + The persistence-context-typeType specifies the transactional + nature of a persistence context reference. + + The value of the persistence-context-type element must be + one of the following: + Transaction + Extended + + + + + + + + + + + + + + + + + + + Specifies a name/value pair. + + + + + + + + + + + + + + + + + + + + myPersistenceUnit + + + + + myPersistenceUnit + + PersistenceUnit1 + + + + ]]> + + + + + + + + + The persistence-unit-ref-name element specifies + the name of a persistence unit reference; its + value is the environment entry name used in + Deployment Component code. The name is a JNDI name + relative to the java:comp/env context. + + + + + + + + + The Application Assembler(or BeanProvider) may use the + following syntax to avoid the need to rename persistence + units to have unique names within a Java EE application. + + The Application Assembler specifies the pathname of the + root of the persistence.xml file for the referenced + persistence unit and appends the name of the persistence + unit separated from the pathname by #. The pathname is + relative to the referencing application component jar file. + In this manner, multiple persistence units with the same + persistence unit name may be uniquely identified when the + Application Assembler cannot change persistence unit names. + + + + + + + + + + + + + + + + com.wombat.empl.EmployeeService + + ]]> + + + + + + + + + + + + + + + jms/StockQueue + + javax.jms.Queue + + + + ]]> + + + + + + + + + The resource-env-ref-name element specifies the name + of a resource environment reference; its value is + the environment entry name used in + the Deployment Component code. The name is a JNDI + name relative to the java:comp/env context and must + be unique within a Deployment Component. + + + + + + + + + The resource-env-ref-type element specifies the type + of a resource environment reference. It is the + fully qualified name of a Java language class or + interface. + + + + + + + + + + + + + + + + + jdbc/EmployeeAppDB + javax.sql.DataSource + Container + Shareable + + + ]]> + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. + The name is a JNDI name relative to the + java:comp/env context. + The name must be unique within a Deployment File. + + + + + + + + + The res-type element specifies the type of the data + source. The type is specified by the fully qualified + Java language class or interface + expected to be implemented by the data source. + + + + + + + + + + + + + + + + + + + The res-authType specifies whether the Deployment Component + code signs on programmatically to the resource manager, or + whether the Container will sign on to the resource manager + on behalf of the Deployment Component. In the latter case, + the Container uses information that is supplied by the + Deployer. + + The value must be one of the two following: + + Application + Container + + + + + + + + + + + + + + + + + + + The res-sharing-scope type specifies whether connections + obtained through the given resource manager connection + factory reference can be shared. The value, if specified, + must be one of the two following: + + Shareable + Unshareable + + The default value is Shareable. + + + + + + + + + + + + + + + + + + + The run-asType specifies the run-as identity to be + used for the execution of a component. It contains an + optional description, and the name of a security role. + + + + + + + + + + + + + + + + + + The role-nameType designates the name of a security role. + + The name must conform to the lexical rules for a token. + + + + + + + + + + + + + + + + + This role includes all employees who are authorized + to access the employee service application. + + employee + + + ]]> + + + + + + + + + + + + + + + + + The security-role-refType contains the declaration of a + security role reference in a component's or a + Deployment Component's code. The declaration consists of an + optional description, the security role name used in the + code, and an optional link to a security role. If the + security role is not specified, the Deployer must choose an + appropriate security role. + + + + + + + + + + The value of the role-name element must be the String used + as the parameter to the + EJBContext.isCallerInRole(String roleName) method or the + HttpServletRequest.isUserInRole(String role) method. + + + + + + + + + The role-link element is a reference to a defined + security role. The role-link element must contain + the name of one of the security roles defined in the + security-role elements. + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:QName. + + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:boolean. + + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:NMTOKEN. + + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:anyURI. + + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:integer. + + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:positiveInteger. + + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:nonNegativeInteger. + + + + + + + + + + + + + + + + + + This type adds an "id" attribute to xsd:string. + + + + + + + + + + + + + + + + + + This is a special string datatype that is defined by Java EE as + a base type for defining collapsed strings. When schemas + require trailing/leading space elimination as well as + collapsing the existing whitespace, this base type may be + used. + + + + + + + + + + + + + + + + + + This simple type designates a boolean with only two + permissible values + + - true + - false + + + + + + + + + + + + + + + + + + The url-patternType contains the url pattern of the mapping. + It must follow the rules specified in Section 11.2 of the + Servlet API Specification. This pattern is assumed to be in + URL-decoded form and must not contain CR(#xD) or LF(#xA). + If it contains those characters, the container must inform + the developer with a descriptive error message. + The container must preserve all characters including whitespaces. + + + + + + + + + + + + + + + + CorporateStocks + + + + ]]> + + + + + + + + + The message-destination-name element specifies a + name for a message destination. This name must be + unique among the names of message destinations + within the Deployment File. + + + + + + + + + A product specific name that this message destination + should be mapped to. Each message-destination-ref + element that references this message destination will + define a name in the namespace of the referencing + component or in one of the other predefined namespaces. + Many application servers provide a way to map these + local names to names of resources known to the + application server. This mapped name is often a global + JNDI name, but may be a name of any form. Each of the + local names should be mapped to this same global name. + + Application servers are not required to support any + particular form or type of mapped name, nor the ability + to use mapped names. The mapped name is + product-dependent and often installation-dependent. No + use of a mapped name is portable. + + + + + + + + + The JNDI name to be looked up to resolve the message destination. + + + + + + + + + + + + + + + + jms/StockQueue + + javax.jms.Queue + + Consumes + + CorporateStocks + + + + ]]> + + + + + + + + + The message-destination-ref-name element specifies + the name of a message destination reference; its + value is the environment entry name used in + Deployment Component code. + + + + + + + + + + + + + + + + + + + + The message-destination-usageType specifies the use of the + message destination indicated by the reference. The value + indicates whether messages are consumed from the message + destination, produced for the destination, or both. The + Assembler makes use of this information in linking producers + of a destination with its consumers. + + The value of the message-destination-usage element must be + one of the following: + Consumes + Produces + ConsumesProduces + + + + + + + + + + + + + + + + + + + javax.jms.Queue + + + ]]> + + + + + + + + + + + + + + + The message-destination-linkType is used to link a message + destination reference or message-driven bean to a message + destination. + + The Assembler sets the value to reflect the flow of messages + between producers and consumers in the application. + + The value must be the message-destination-name of a message + destination in the same Deployment File or in another + Deployment File in the same Java EE application unit. + + Alternatively, the value may be composed of a path name + specifying a Deployment File containing the referenced + message destination with the message-destination-name of the + destination appended and separated from the path name by + "#". The path name is relative to the Deployment File + containing Deployment Component that is referencing the + message destination. This allows multiple message + destinations with the same name to be uniquely identified. + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/javaee_web_services_client_1_3.xsd b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/javaee_web_services_client_1_3.xsd new file mode 100644 index 00000000000..5c673ae9156 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/javaee_web_services_client_1_3.xsd @@ -0,0 +1,737 @@ + + + + + + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. + + The contents of this file are subject to the terms of either the + GNU General Public License Version 2 only ("GPL") or the Common + Development and Distribution License("CDDL") (collectively, the + "License"). You may not use this file except in compliance with + the License. You can obtain a copy of the License at + https://glassfish.dev.java.net/public/CDDL+GPL.html or + glassfish/bootstrap/legal/LICENSE.txt. See the License for the + specific language governing permissions and limitations under the + License. + + When distributing the software, include this License Header + Notice in each file and include the License file at + glassfish/bootstrap/legal/LICENSE.txt. Sun designates this + particular file as subject to the "Classpath" exception as + provided by Sun in the GPL Version 2 section of the License file + that accompanied this code. If applicable, add the following + below the License Header, with the fields enclosed by brackets [] + replaced by your own identifying information: + "Portions Copyrighted [year] [name of copyright owner]" + + Contributor(s): + + If you wish your version of this file to be governed by only the + CDDL or only the GPL Version 2, indicate your decision by adding + "[Contributor] elects to include this software in this + distribution under the [CDDL or GPL Version 2] license." If you + don't indicate a single choice of license, a recipient has the + option to distribute your version of this file under either the + CDDL, the GPL Version 2 or to extend the choice of license to its + licensees as provided above. However, if you add GPL Version 2 + code and therefore, elected the GPL Version 2 license, then the + option applies only if the new code is made subject to such + option by the copyright holder. + + + + + + + + (C) Copyright International Business Machines Corporation 2002 + + + + + + + + + + + + The service-ref element declares a reference to a Web + service. It contains optional description, display name and + icons, a declaration of the required Service interface, + an optional WSDL document location, an optional set + of JAX-RPC mappings, an optional QName for the service element, + an optional set of Service Endpoint Interfaces to be resolved + by the container to a WSDL port, and an optional set of handlers. + + + + + + + + + + The service-ref-name element declares logical name that the + components in the module use to look up the Web service. It + is recommended that all service reference names start with + "service/". + + + + + + + + + The service-interface element declares the fully qualified class + name of the JAX-RPC Service interface the client depends on. + In most cases the value will be javax.xml.rpc.Service. A JAX-RPC + generated Service Interface class may also be specified. + + + + + + + + + The service-ref-type element declares the type of the service-ref + element that is injected or returned when a JNDI lookup is done. + This must be either a fully qualified name of Service class or + the fully qualified name of service endpoint interface class. + This is only used with JAX-WS runtime where the corresponding + @WebServiceRef annotation can be used to denote both a Service + or a Port. + + If this is not specified, then the type of service-ref element + that is injected or returned when a JNDI lookup is done is + always a Service interface/class. + + + + + + + + + The wsdl-file element contains the URI location of a WSDL + file. The location is relative to the root of the module. + + + + + + + + + The jaxrpc-mapping-file element contains the name of a file that + describes the JAX-RPC mapping between the Java interaces used by + the application and the WSDL description in the wsdl-file. The + file name is a relative path within the module file. + + This is not required when JAX-WS based runtime is used. + + + + + + + + + The service-qname element declares the specific WSDL service + element that is being refered to. It is not specified if no + wsdl-file is declared. + + + + + + + + + The port-component-ref element declares a client dependency + on the container for resolving a Service Endpoint Interface + to a WSDL port. It optionally associates the Service Endpoint + Interface with a particular port-component. This is only used + by the container for a Service.getPort(Class) method call. + + + + + + + + + + Declares the handler for a port-component. Handlers can + access the init-param name/value pairs using the + HandlerInfo interface. If port-name is not specified, the + handler is assumed to be associated with all ports of the + service. + + To be used with JAX-RPC based runtime only. + + + + + + + + + To be used with JAX-WS based runtime only. + + + + + + + + + + + + + + + + + + The port-component-ref element declares a client dependency + on the container for resolving a Service Endpoint Interface + to a WSDL port. It optionally associates the Service Endpoint + Interface with a particular port-component. This is only used + by the container for a Service.getPort(Class) method call. + + + + + + + + + The service-endpoint-interface element defines a fully qualified + Java class that represents the Service Endpoint Interface of a + WSDL port. + + + + + + + + + Used to enable or disable SOAP MTOM/XOP mechanism on the client + side for a port-component. + + Not to be specified for JAX-RPC runtime + + + + + + + + + When MTOM is enabled, binary data above this size in bytes + should be XOP encoded or sent as attachment. Default value is 0. + + Not to be specified for JAX-RPC runtime + + + + + + + + + This specifies the WS-Addressing requirements for a JAX-WS + web service. It corresponds to javax.xml.ws.soap.Addressing + annotation or its feature javax.xml.ws.soap.AddressingFeature. + + See the addressingType for more information. + + Not to be specified for JAX-RPC runtime + + + + + + + + + Corresponds to the javax.xml.ws.RespectBinding annotation + or its corresponding javax.xml.ws.RespectBindingFeature web + service feature. This is used to control whether a JAX-WS + implementation must respect/honor the contents of the + wsdl:binding in the WSDL that is associated with the service. + + Not to be specified for JAX-RPC runtime + + + + + + + + + The port-component-link element links a port-component-ref + to a specific port-component required to be made available + by a service reference. + + The value of a port-component-link must be the + port-component-name of a port-component in the same module + or another module in the same application unit. The syntax + for specification follows the syntax defined for ejb-link + in the EJB 2.0 specification. + + + + + + + + + + + + + + + + The handler-chains element defines the handlerchains associated with this + service or service endpoint. + + + + + + + + + + + + + + + + + The handler-chain element defines the handlerchain. + Handlerchain can be defined such that the handlers in the + handlerchain operate,all ports of a service, on a specific + port or on a list of protocol-bindings. The choice of elements + service-name-pattern, port-name-pattern and protocol-bindings + are used to specify whether the handlers in handler-chain are + for a service, port or protocol binding. If none of these + choices are specified with the handler-chain element then the + handlers specified in the handler-chain will be applied on + everything. + + + + + + + + + + + + + + + + + + + Defines the type used for specifying a list of + protocol-bindingType(s). For e.g. + + ##SOAP11_HTTP ##SOAP12_HTTP ##XML_HTTP + + + + + + + + + + + Defines the type used for specifying the URI for the + protocol binding used by the port-component. For + portability one could use one of the following tokens that + alias the standard binding types: + + ##SOAP11_HTTP + ##SOAP11_HTTP_MTOM + ##SOAP12_HTTP + ##SOAP12_HTTP_MTOM + ##XML_HTTP + + Other specifications could define tokens that start with ## + to alias new standard binding URIs that are introduced. + + + + + + + + + + + Defines the type that is used for specifying tokens that + start with ## which are used to alias existing standard + protocol bindings and support aliases for new standard + binding URIs that are introduced in future specifications. + + The following tokens alias the standard protocol binding + URIs: + + ##SOAP11_HTTP = "http://schemas.xmlsoap.org/wsdl/soap/http" + ##SOAP11_HTTP_MTOM = + "http://schemas.xmlsoap.org/wsdl/soap/http?mtom=true" + ##SOAP12_HTTP = "http://www.w3.org/2003/05/soap/bindings/HTTP/" + ##SOAP12_HTTP_MTOM = + "http://www.w3.org/2003/05/soap/bindings/HTTP/?mtom=true" + ##XML_HTTP = "http://www.w3.org/2004/08/wsdl/http" + + + + + + + + + + + + + This is used to specify the QName pattern in the + attribute service-name-pattern and port-name-pattern in + the handler-chain element + + For example, the various forms acceptable here for + service-name-pattern attribute in handler-chain element + are : + + Exact Name: service-name-pattern="ns1:EchoService" + + In this case, handlers specified in this + handler-chain element will apply to all ports with + this exact service name. The namespace prefix must + have been declared in a namespace declaration + attribute in either the start-tag of the element + where the prefix is used or in an an ancestor + element (i.e. an element in whose content the + prefixed markup occurs) + + + Pattern : service-name-pattern="ns1:EchoService*" + + In this case, handlers specified in this + handler-chain element will apply to all ports whose + Service names are like EchoService1, EchoServiceFoo + etc. The namespace prefix must have been declared in + a namespace declaration attribute in either the + start-tag of the element where the prefix is used or + in an an ancestor element (i.e. an element in whose + content the prefixed markup occurs) + + Wild Card : service-name-pattern="*" + + In this case, handlers specified in this handler-chain + element will apply to ports of all service names. + + The same can be applied to port-name attribute in + handler-chain element. + + + + + + + + + + + + + + + + This specifies the WS-Addressing requirements for a JAX-WS web service. + It corresponds to javax.xml.ws.soap.Addressing annotation or its + feature javax.xml.ws.soap.AddressingFeature. + + If the "enabled" element is "true", WS-Addressing is enabled. + It means that the endpoint supports WS-Addressing but does not require + its use. The default value for "enabled" is "true". + + If the WS-Addressing is enabled and the "required" element is "true", + it means that the endpoint requires WS-Addressing. The default value + for "required" is "false". + + If WS-Addressing is enabled, the "responses" element determines + if an endpoint requires the use of only anonymous responses, + or only non-anonymous responses, or all. The value of the "responses" + element must be one of the following: + + ANONYMOUS + NON_ANONYMOUS + ALL + + The default value for the "responses" is ALL. + + + + + + + + + + + + + + + + + + If WS-Addressing is enabled, this type determines if an endpoint + requires the use of only anonymous responses, or only non-anonymous + responses, or all. + + + + + + + + + + + + + + + + + + + + Corresponds to the javax.xml.ws.RespectBinding annotation + or its corresponding javax.xml.ws.RespectBindingFeature web + service feature. This is used to control whether a JAX-WS + implementation must respect/honor the contents of the + wsdl:binding in the WSDL that is associated with the service. + + If the "enabled" element is "true", wsdl:binding in the + associated WSDL, if any, must be respected/honored. + + + + + + + + + + + + + + + + Declares the handler for a port-component, service-ref. Handlers can + access the init-param name/value pairs using the HandlerInfo interface. + + Used in: port-component, service-ref + + + + + + + + + + Defines the name of the handler. The name must be unique within the + module. + + + + + + + + + Defines a fully qualified class name for the handler implementation. + + + + + + + + + Not to be specified for JAX-WS runtime + + + + + + + + + Defines the QName of a SOAP header that will be processed by the + handler. + + Not to be specified for JAX-WS runtime + + + + + + + + + The soap-role element contains a SOAP actor definition that the + Handler will play as a role. + + + + + + + + + The port-name element defines the WSDL port-name that a + handler should be associated with. If port-name is not + specified, the handler is assumed to be associated with + all ports of the service. + + Not to be specified for JAX-WS runtime + + + + + + + + + + + + + + + + Defines the name of the handler. The name must be unique + within the module. + + + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/jsp_2_2.xsd b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/jsp_2_2.xsd new file mode 100644 index 00000000000..fa41e4266f1 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/jsp_2_2.xsd @@ -0,0 +1,389 @@ + + + + + + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. + + The contents of this file are subject to the terms of either the + GNU General Public License Version 2 only ("GPL") or the Common + Development and Distribution License("CDDL") (collectively, the + "License"). You may not use this file except in compliance with + the License. You can obtain a copy of the License at + https://glassfish.dev.java.net/public/CDDL+GPL.html or + glassfish/bootstrap/legal/LICENSE.txt. See the License for the + specific language governing permissions and limitations under the + License. + + When distributing the software, include this License Header + Notice in each file and include the License file at + glassfish/bootstrap/legal/LICENSE.txt. Sun designates this + particular file as subject to the "Classpath" exception as + provided by Sun in the GPL Version 2 section of the License file + that accompanied this code. If applicable, add the following + below the License Header, with the fields enclosed by brackets [] + replaced by your own identifying information: + "Portions Copyrighted [year] [name of copyright owner]" + + Contributor(s): + + If you wish your version of this file to be governed by only the + CDDL or only the GPL Version 2, indicate your decision by adding + "[Contributor] elects to include this software in this + distribution under the [CDDL or GPL Version 2] license." If you + don't indicate a single choice of license, a recipient has the + option to distribute your version of this file under either the + CDDL, the GPL Version 2 or to extend the choice of license to its + licensees as provided above. However, if you add GPL Version 2 + code and therefore, elected the GPL Version 2 license, then the + option applies only if the new code is made subject to such + option by the copyright holder. + + + + + + + + This is the XML Schema for the JSP 2.2 deployment descriptor + types. The JSP 2.2 schema contains all the special + structures and datatypes that are necessary to use JSP files + from a web application. + + The contents of this schema is used by the web-common_3_0.xsd + file to define JSP specific content. + + + + + + + + The following conventions apply to all Java EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The jsp-configType is used to provide global configuration + information for the JSP files in a web application. It has + two subelements, taglib and jsp-property-group. + + + + + + + + + + + + + + + + + + The jsp-file element contains the full path to a JSP file + within the web application beginning with a `/'. + + + + + + + + + + + + + + + + The jsp-property-groupType is used to group a number of + files so they can be given global property information. + All files so described are deemed to be JSP files. The + following additional properties can be described: + + - Control whether EL is ignored. + - Control whether scripting elements are invalid. + - Indicate pageEncoding information. + - Indicate that a resource is a JSP document (XML). + - Prelude and Coda automatic includes. + - Control whether the character sequence #{ is allowed + when used as a String literal. + - Control whether template text containing only + whitespaces must be removed from the response output. + - Indicate the default contentType information. + - Indicate the default buffering model for JspWriter + - Control whether error should be raised for the use of + undeclared namespaces in a JSP page. + + + + + + + + + + + Can be used to easily set the isELIgnored + property of a group of JSP pages. By default, the + EL evaluation is enabled for Web Applications using + a Servlet 2.4 or greater web.xml, and disabled + otherwise. + + + + + + + + + The valid values of page-encoding are those of the + pageEncoding page directive. It is a + translation-time error to name different encodings + in the pageEncoding attribute of the page directive + of a JSP page and in a JSP configuration element + matching the page. It is also a translation-time + error to name different encodings in the prolog + or text declaration of a document in XML syntax and + in a JSP configuration element matching the document. + It is legal to name the same encoding through + mulitple mechanisms. + + + + + + + + + Can be used to easily disable scripting in a + group of JSP pages. By default, scripting is + enabled. + + + + + + + + + If true, denotes that the group of resources + that match the URL pattern are JSP documents, + and thus must be interpreted as XML documents. + If false, the resources are assumed to not + be JSP documents, unless there is another + property group that indicates otherwise. + + + + + + + + + The include-prelude element is a context-relative + path that must correspond to an element in the + Web Application. When the element is present, + the given path will be automatically included (as + in an include directive) at the beginning of each + JSP page in this jsp-property-group. + + + + + + + + + The include-coda element is a context-relative + path that must correspond to an element in the + Web Application. When the element is present, + the given path will be automatically included (as + in an include directive) at the end of each + JSP page in this jsp-property-group. + + + + + + + + + The character sequence #{ is reserved for EL expressions. + Consequently, a translation error occurs if the #{ + character sequence is used as a String literal, unless + this element is enabled (true). Disabled (false) by + default. + + + + + + + + + Indicates that template text containing only whitespaces + must be removed from the response output. It has no + effect on JSP documents (XML syntax). Disabled (false) + by default. + + + + + + + + + The valid values of default-content-type are those of the + contentType page directive. It specifies the default + response contentType if the page directive does not include + a contentType attribute. + + + + + + + + + The valid values of buffer are those of the + buffer page directive. It specifies if buffering should be + used for the output to response, and if so, the size of the + buffer to use. + + + + + + + + + The default behavior when a tag with unknown namespace is used + in a JSP page (regular syntax) is to silently ignore it. If + set to true, then an error must be raised during the translation + time when an undeclared tag is used in a JSP page. Disabled + (false) by default. + + + + + + + + + + + + + + + + The taglibType defines the syntax for declaring in + the deployment descriptor that a tag library is + available to the application. This can be done + to override implicit map entries from TLD files and + from the container. + + + + + + + + + A taglib-uri element describes a URI identifying a + tag library used in the web application. The body + of the taglib-uri element may be either an + absolute URI specification, or a relative URI. + There should be no entries in web.xml with the + same taglib-uri value. + + + + + + + + + the taglib-location element contains the location + (as a resource relative to the root of the web + application) where to find the Tag Library + Description file for the tag library. + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/web-app_3_0.xsd b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/web-app_3_0.xsd new file mode 100644 index 00000000000..bbcdf43cd3a --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/web-app_3_0.xsd @@ -0,0 +1,272 @@ + + + + + + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. + + The contents of this file are subject to the terms of either the + GNU General Public License Version 2 only ("GPL") or the Common + Development and Distribution License("CDDL") (collectively, the + "License"). You may not use this file except in compliance with + the License. You can obtain a copy of the License at + https://glassfish.dev.java.net/public/CDDL+GPL.html or + glassfish/bootstrap/legal/LICENSE.txt. See the License for the + specific language governing permissions and limitations under the + License. + + When distributing the software, include this License Header + Notice in each file and include the License file at + glassfish/bootstrap/legal/LICENSE.txt. Sun designates this + particular file as subject to the "Classpath" exception as + provided by Sun in the GPL Version 2 section of the License file + that accompanied this code. If applicable, add the following + below the License Header, with the fields enclosed by brackets [] + replaced by your own identifying information: + "Portions Copyrighted [year] [name of copyright owner]" + + Contributor(s): + + If you wish your version of this file to be governed by only the + CDDL or only the GPL Version 2, indicate your decision by adding + "[Contributor] elects to include this software in this + distribution under the [CDDL or GPL Version 2] license." If you + don't indicate a single choice of license, a recipient has the + option to distribute your version of this file under either the + CDDL, the GPL Version 2 or to extend the choice of license to its + licensees as provided above. However, if you add GPL Version 2 + code and therefore, elected the GPL Version 2 license, then the + option applies only if the new code is made subject to such + option by the copyright holder. + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Java EE + namespace with the following location: + + http://java.sun.com/xml/ns/javaee/web-app_3_0.xsd + + ]]> + + + + + + + The following conventions apply to all Java EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + The web-app element is the root of the deployment + descriptor for a web application. Note that the sub-elements + of this element can be in the arbitrary order. Because of + that, the multiplicity of the elements of distributable, + session-config, welcome-file-list, jsp-config, login-config, + and locale-encoding-mapping-list was changed from "?" to "*" + in this schema. However, the deployment descriptor instance + file must not contain multiple elements of session-config, + jsp-config, and login-config. When there are multiple elements of + welcome-file-list or locale-encoding-mapping-list, the container + must concatenate the element contents. The multiple occurence + of the element distributable is redundant and the container + treats that case exactly in the same way when there is only + one distributable. + + + + + + + + The servlet element contains the name of a servlet. + The name must be unique within the web application. + + + + + + + + + + + The filter element contains the name of a filter. + The name must be unique within the web application. + + + + + + + + + + + The ejb-local-ref-name element contains the name of an EJB + reference. The EJB reference is an entry in the web + application's environment and is relative to the + java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The ejb-ref-name element contains the name of an EJB + reference. The EJB reference is an entry in the web + application's environment and is relative to the + java:comp/env context. The name must be unique within + the web application. + + It is recommended that name is prefixed with "ejb/". + + + + + + + + + + + The resource-env-ref-name element specifies the name of + a resource environment reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + The message-destination-ref-name element specifies the name of + a message destination reference; its value is the + environment entry name used in the web application code. + The name is a JNDI name relative to the java:comp/env + context and must be unique within a web application. + + + + + + + + + + + The res-ref-name element specifies the name of a + resource manager connection factory reference. The name + is a JNDI name relative to the java:comp/env context. + The name must be unique within a web application. + + + + + + + + + + + The env-entry-name element contains the name of a web + application's environment entry. The name is a JNDI + name relative to the java:comp/env context. The name + must be unique within a web application. + + + + + + + + + + + A role-name-key is specified to allow the references + from the security-role-refs. + + + + + + + + + + + The keyref indicates the references from + security-role-ref to a specified role-name. + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/web-common_3_0.xsd b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/web-common_3_0.xsd new file mode 100644 index 00000000000..f994bc2c651 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/web-common_3_0.xsd @@ -0,0 +1,1575 @@ + + + + + + DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER. + + Copyright 2003-2009 Sun Microsystems, Inc. All rights reserved. + + The contents of this file are subject to the terms of either the + GNU General Public License Version 2 only ("GPL") or the Common + Development and Distribution License("CDDL") (collectively, the + "License"). You may not use this file except in compliance with + the License. You can obtain a copy of the License at + https://glassfish.dev.java.net/public/CDDL+GPL.html or + glassfish/bootstrap/legal/LICENSE.txt. See the License for the + specific language governing permissions and limitations under the + License. + + When distributing the software, include this License Header + Notice in each file and include the License file at + glassfish/bootstrap/legal/LICENSE.txt. Sun designates this + particular file as subject to the "Classpath" exception as + provided by Sun in the GPL Version 2 section of the License file + that accompanied this code. If applicable, add the following + below the License Header, with the fields enclosed by brackets [] + replaced by your own identifying information: + "Portions Copyrighted [year] [name of copyright owner]" + + Contributor(s): + + If you wish your version of this file to be governed by only the + CDDL or only the GPL Version 2, indicate your decision by adding + "[Contributor] elects to include this software in this + distribution under the [CDDL or GPL Version 2] license." If you + don't indicate a single choice of license, a recipient has the + option to distribute your version of this file under either the + CDDL, the GPL Version 2 or to extend the choice of license to its + licensees as provided above. However, if you add GPL Version 2 + code and therefore, elected the GPL Version 2 license, then the + option applies only if the new code is made subject to such + option by the copyright holder. + + + + + + + + ... + + + The instance documents may indicate the published version of + the schema using the xsi:schemaLocation attribute for Java EE + namespace with the following location: + + http://java.sun.com/xml/ns/javaee/web-common_3_0.xsd + + ]]> + + + + + + + The following conventions apply to all Java EE + deployment descriptor elements unless indicated otherwise. + + - In elements that specify a pathname to a file within the + same JAR file, relative filenames (i.e., those not + starting with "/") are considered relative to the root of + the JAR file's namespace. Absolute filenames (i.e., those + starting with "/") also specify names in the root of the + JAR file's namespace. In general, relative names are + preferred. The exception is .war files where absolute + names are preferred for consistency with the Servlet API. + + + + + + + + + + + + + + + + + The context-param element contains the declaration + of a web application's servlet context + initialization parameters. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The metadata-complete attribute defines whether this + deployment descriptor and other related deployment + descriptors for this module (e.g., web service + descriptors) are complete, or whether the class + files available to this module and packaged with + this application should be examined for annotations + that specify deployment information. + + If metadata-complete is set to "true", the deployment + tool must ignore any annotations that specify deployment + information, which might be present in the class files + of the application. + + If metadata-complete is not specified or is set to + "false", the deployment tool must examine the class + files of the application for annotations, as + specified by the specifications. + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + The auth-constraintType indicates the user roles that + should be permitted access to this resource + collection. The role-name used here must either correspond + to the role-name of one of the security-role elements + defined for this web application, or be the specially + reserved role-name "*" that is a compact syntax for + indicating all roles in the web application. If both "*" + and rolenames appear, the container interprets this as all + roles. If no roles are defined, no user is allowed access + to the portion of the web application described by the + containing security-constraint. The container matches + role names case sensitively when determining access. + + + + + + + + + + + + + + + + + + The auth-methodType is used to configure the authentication + mechanism for the web application. As a prerequisite to + gaining access to any web resources which are protected by + an authorization constraint, a user must have authenticated + using the configured mechanism. Legal values are "BASIC", + "DIGEST", "FORM", "CLIENT-CERT", or a vendor-specific + authentication scheme. + + Used in: login-config + + + + + + + + + + + + + + + + The dispatcher has five legal values: FORWARD, REQUEST, + INCLUDE, ASYNC, and ERROR. + + A value of FORWARD means the Filter will be applied under + RequestDispatcher.forward() calls. + A value of REQUEST means the Filter will be applied under + ordinary client calls to the path or servlet. + A value of INCLUDE means the Filter will be applied under + RequestDispatcher.include() calls. + A value of ASYNC means the Filter will be applied under + calls dispatched from an AsyncContext. + A value of ERROR means the Filter will be applied under the + error page mechanism. + + The absence of any dispatcher elements in a filter-mapping + indicates a default of applying filters only under ordinary + client calls to the path or servlet. + + + + + + + + + + + + + + + + + + + + + + The error-code contains an HTTP error code, ex: 404 + + Used in: error-page + + + + + + + + + + + + + + + + + + + The error-pageType contains a mapping between an error code + or exception type to the path of a resource in the web + application. + + Error-page declarations using the exception-type element in + the deployment descriptor must be unique up to the class name of + the exception-type. Similarly, error-page declarations using the + status-code element must be unique in the deployment descriptor + up to the status code. + + Used in: web-app + + + + + + + + + + + The exception-type contains a fully qualified class + name of a Java exception type. + + + + + + + + + + The location element contains the location of the + resource in the web application relative to the root of + the web application. The value of the location must have + a leading `/'. + + + + + + + + + + + + + + + + The filterType is used to declare a filter in the web + application. The filter is mapped to either a servlet or a + URL pattern in the filter-mapping element, using the + filter-name value to reference. Filters can access the + initialization parameters declared in the deployment + descriptor at runtime via the FilterConfig interface. + + Used in: web-app + + + + + + + + + + + The fully qualified classname of the filter. + + + + + + + + + + The init-param element contains a name/value pair as + an initialization param of a servlet filter + + + + + + + + + + + + + + + + Declaration of the filter mappings in this web + application is done by using filter-mappingType. + The container uses the filter-mapping + declarations to decide which filters to apply to a request, + and in what order. The container matches the request URI to + a Servlet in the normal way. To determine which filters to + apply it matches filter-mapping declarations either on + servlet-name, or on url-pattern for each filter-mapping + element, depending on which style is used. The order in + which filters are invoked is the order in which + filter-mapping declarations that match a request URI for a + servlet appear in the list of filter-mapping elements.The + filter-name value must be the value of the filter-name + sub-elements of one of the filter declarations in the + deployment descriptor. + + + + + + + + + + + + + + + + + + + + + + This type defines a string which contains at least one + character. + + + + + + + + + + + + + + + + + + The logical name of the filter is declare + by using filter-nameType. This name is used to map the + filter. Each filter name is unique within the web + application. + + Used in: filter, filter-mapping + + + + + + + + + + + + + + + + The form-login-configType specifies the login and error + pages that should be used in form based login. If form based + authentication is not used, these elements are ignored. + + Used in: login-config + + + + + + + + + The form-login-page element defines the location in the web + app where the page that can be used for login can be + found. The path begins with a leading / and is interpreted + relative to the root of the WAR. + + + + + + + + + The form-error-page element defines the location in + the web app where the error page that is displayed + when login is not successful can be found. + The path begins with a leading / and is interpreted + relative to the root of the WAR. + + + + + + + + + + + + + A HTTP method type as defined in HTTP 1.1 section 2.2. + + + + + + + + + + + + + + + + + + + + + + + + + + The login-configType is used to configure the authentication + method that should be used, the realm name that should be + used for this application, and the attributes that are + needed by the form login mechanism. + + Used in: web-app + + + + + + + + + + The realm name element specifies the realm name to + use in HTTP Basic authorization. + + + + + + + + + + + + + + + + + The mime-mappingType defines a mapping between an extension + and a mime type. + + Used in: web-app + + + + + + + + The extension element contains a string describing an + extension. example: "txt" + + + + + + + + + + + + + + + + + The mime-typeType is used to indicate a defined mime type. + + Example: + "text/plain" + + Used in: mime-mapping + + + + + + + + + + + + + + + + + + The security-constraintType is used to associate + security constraints with one or more web resource + collections + + Used in: web-app + + + + + + + + + + + + + + + + + + + + The servletType is used to declare a servlet. + It contains the declarative data of a + servlet. If a jsp-file is specified and the load-on-startup + element is present, then the JSP should be precompiled and + loaded. + + Used in: web-app + + + + + + + + + + + + The servlet-class element contains the fully + qualified class name of the servlet. + + + + + + + + + + + + The load-on-startup element indicates that this + servlet should be loaded (instantiated and have + its init() called) on the startup of the web + application. The optional contents of these + element must be an integer indicating the order in + which the servlet should be loaded. If the value + is a negative integer, or the element is not + present, the container is free to load the servlet + whenever it chooses. If the value is a positive + integer or 0, the container must load and + initialize the servlet as the application is + deployed. The container must guarantee that + servlets marked with lower integers are loaded + before servlets marked with higher integers. The + container may choose the order of loading of + servlets with the same load-on-start-up value. + + + + + + + + + + + + + + + + + + + + + The servlet-mappingType defines a mapping between a + servlet and a url pattern. + + Used in: web-app + + + + + + + + + + + + + + + + + + The servlet-name element contains the canonical name of the + servlet. Each servlet name is unique within the web + application. + + + + + + + + + + + + + + + + The session-configType defines the session parameters + for this web application. + + Used in: web-app + + + + + + + + + The session-timeout element defines the default + session timeout interval for all sessions created + in this web application. The specified timeout + must be expressed in a whole number of minutes. + If the timeout is 0 or less, the container ensures + the default behaviour of sessions is never to time + out. If this element is not specified, the container + must set its default timeout period. + + + + + + + + + The cookie-config element defines the configuration of the + session tracking cookies created by this web application. + + + + + + + + + The tracking-mode element defines the tracking modes + for sessions created by this web application + + + + + + + + + + + + + + + + The cookie-configType defines the configuration for the + session tracking cookies of this web application. + + Used in: session-config + + + + + + + + + The name that will be assigned to any session tracking + cookies created by this web application. + The default is JSESSIONID + + + + + + + + + The domain name that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + The path that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + The comment that will be assigned to any session tracking + cookies created by this web application. + + + + + + + + + Specifies whether any session tracking cookies created + by this web application will be marked as HttpOnly + + + + + + + + + Specifies whether any session tracking cookies created + by this web application will be marked as secure + even if the request that initiated the corresponding session + is using plain HTTP instead of HTTPS + + + + + + + + + The lifetime (in seconds) that will be assigned to any + session tracking cookies created by this web application. + Default is -1 + + + + + + + + + + + + + + + + The name that will be assigned to any session tracking + cookies created by this web application. + The default is JSESSIONID + + Used in: cookie-config + + + + + + + + + + + + + + + + The domain name that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The path that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The comment that will be assigned to any session tracking + cookies created by this web application. + + Used in: cookie-config + + + + + + + + + + + + + + + + The tracking modes for sessions created by this web + application + + Used in: session-config + + + + + + + + + + + + + + + + + + + + The transport-guaranteeType specifies that the communication + between client and server should be NONE, INTEGRAL, or + CONFIDENTIAL. NONE means that the application does not + require any transport guarantees. A value of INTEGRAL means + that the application requires that the data sent between the + client and server be sent in such a way that it can't be + changed in transit. CONFIDENTIAL means that the application + requires that the data be transmitted in a fashion that + prevents other entities from observing the contents of the + transmission. In most cases, the presence of the INTEGRAL or + CONFIDENTIAL flag will indicate that the use of SSL is + required. + + Used in: user-data-constraint + + + + + + + + + + + + + + + + + + + + The user-data-constraintType is used to indicate how + data communicated between the client and container should be + protected. + + Used in: security-constraint + + + + + + + + + + + + + + + + + + The elements that use this type designate a path starting + with a "/" and interpreted relative to the root of a WAR + file. + + + + + + + + + + + + + + + This type contains the recognized versions of + web-application supported. It is used to designate the + version of the web application. + + + + + + + + + + + + + + + + The web-resource-collectionType is used to identify the + resources and HTTP methods on those resources to which a + security constraint applies. If no HTTP methods are specified, + then the security constraint applies to all HTTP methods. + If HTTP methods are specified by http-method-omission + elements, the security constraint applies to all methods + except those identified in the collection. + http-method-omission and http-method elements are never + mixed in the same collection. + + Used in: security-constraint + + + + + + + + + The web-resource-name contains the name of this web + resource collection. + + + + + + + + + + + + Each http-method names an HTTP method to which the + constraint applies. + + + + + + + + + Each http-method-omission names an HTTP method to + which the constraint does not apply. + + + + + + + + + + + + + + + + + The welcome-file-list contains an ordered list of welcome + files elements. + + Used in: web-app + + + + + + + + + The welcome-file element contains file name to use + as a default welcome file, such as index.html + + + + + + + + + + + + + The localeType defines valid locale defined by ISO-639-1 + and ISO-3166. + + + + + + + + + + + + + The encodingType defines IANA character sets. + + + + + + + + + + + + + + + + The locale-encoding-mapping-list contains one or more + locale-encoding-mapping(s). + + + + + + + + + + + + + + + + + The locale-encoding-mapping contains locale name and + encoding name. The locale name must be either "Language-code", + such as "ja", defined by ISO-639 or "Language-code_Country-code", + such as "ja_JP". "Country code" is defined by ISO-3166. + + + + + + + + + + + + + + + + + + This element indicates that the ordering sub-element in which + it was placed should take special action regarding the ordering + of this application resource relative to other application + configuration resources. + See section 8.2.2 of the specification for details. + + + + + + + + + + + + + + Please see section 8.2.2 of the specification for details. + + + + + + + + + + + + + + + + + Please see section 8.2.2 of the specification for details. + + + + + + + + + + + + + + + + + This element contains a sequence of "name" elements, each of + which + refers to an application configuration resource by the "name" + declared on its web.xml fragment. This element can also contain + a single "others" element which specifies that this document + comes + before or after other documents within the application. + See section 8.2.2 of the specification for details. + + + + + + + + + + + + + + + + + This element specifies configuration information related to the + handling of multipart/form-data requests. + + + + + + + + + The directory location where uploaded files will be stored + + + + + + + + + The maximum size limit of uploaded files + + + + + + + + + The maximum size limit of multipart/form-data requests + + + + + + + + + The size threshold after which an uploaded file will be + written to disk + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/xml.xsd b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/xml.xsd new file mode 100644 index 00000000000..aea7d0db0a4 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/main/webapp/WEB-INF/xsd/xml.xsd @@ -0,0 +1,287 @@ + + + + + + +
+

About the XML namespace

+ +
+

+ This schema document describes the XML namespace, in a form + suitable for import by other schema documents. +

+

+ See + http://www.w3.org/XML/1998/namespace.html and + + http://www.w3.org/TR/REC-xml for information + about this namespace. +

+

+ Note that local names in this namespace are intended to be + defined only by the World Wide Web Consortium or its subgroups. + The names currently defined in this namespace are listed below. + They should not be used with conflicting semantics by any Working + Group, specification, or document instance. +

+

+ See further below in this document for more information about how to refer to this schema document from your own + XSD schema documents and about the + namespace-versioning policy governing this schema document. +

+
+
+
+
+ + + + +
+ +

lang (as an attribute name)

+

+ denotes an attribute whose value + is a language code for the natural language of the content of + any element; its value is inherited. This name is reserved + by virtue of its definition in the XML specification.

+ +
+
+

Notes

+

+ Attempting to install the relevant ISO 2- and 3-letter + codes as the enumerated possible values is probably never + going to be a realistic possibility. +

+

+ See BCP 47 at + http://www.rfc-editor.org/rfc/bcp/bcp47.txt + and the IANA language subtag registry at + + http://www.iana.org/assignments/language-subtag-registry + for further information. +

+

+ The union allows for the 'un-declaration' of xml:lang with + the empty string. +

+
+
+
+ + + + + + + + + +
+ + + + +
+ +

space (as an attribute name)

+

+ denotes an attribute whose + value is a keyword indicating what whitespace processing + discipline is intended for the content of the element; its + value is inherited. This name is reserved by virtue of its + definition in the XML specification.

+ +
+
+
+ + + + + + +
+ + + +
+ +

base (as an attribute name)

+

+ denotes an attribute whose value + provides a URI to be used as the base for interpreting any + relative URIs in the scope of the element on which it + appears; its value is inherited. This name is reserved + by virtue of its definition in the XML Base specification.

+ +

+ See http://www.w3.org/TR/xmlbase/ + for information about this attribute. +

+
+
+
+
+ + + + +
+ +

id (as an attribute name)

+

+ denotes an attribute whose value + should be interpreted as if declared to be of type ID. + This name is reserved by virtue of its definition in the + xml:id specification.

+ +

+ See http://www.w3.org/TR/xml-id/ + for information about this attribute. +

+
+
+
+
+ + + + + + + + + + +
+ +

Father (in any context at all)

+ +
+

+ denotes Jon Bosak, the chair of + the original XML Working Group. This name is reserved by + the following decision of the W3C XML Plenary and + XML Coordination groups: +

+
+

+ In appreciation for his vision, leadership and + dedication the W3C XML Plenary on this 10th day of + February, 2000, reserves for Jon Bosak in perpetuity + the XML name "xml:Father". +

+
+
+
+
+
+ + + +
+

About this schema document

+ +
+

+ This schema defines attributes and an attribute group suitable + for use by schemas wishing to allow xml:base, + xml:lang, xml:space or + xml:id attributes on elements they define. +

+

+ To enable this, such a schema must import this schema for + the XML namespace, e.g. as follows: +

+
+          <schema . . .>
+           . . .
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2001/xml.xsd"/>
+     
+

+ or +

+
+           <import namespace="http://www.w3.org/XML/1998/namespace"
+                      schemaLocation="http://www.w3.org/2009/01/xml.xsd"/>
+     
+

+ Subsequently, qualified reference to any of the attributes or the + group defined below will have the desired effect, e.g. +

+
+          <type . . .>
+           . . .
+           <attributeGroup ref="xml:specialAttrs"/>
+     
+

+ will define a type which will schema-validate an instance element + with any of those attributes. +

+
+
+
+
+ + + +
+

Versioning policy for this schema document

+
+

+ In keeping with the XML Schema WG's standard versioning + policy, this schema document will persist at + + http://www.w3.org/2009/01/xml.xsd. +

+

+ At the date of issue it can also be found at + + http://www.w3.org/2001/xml.xsd. +

+

+ The schema document at that URI may however change in the future, + in order to remain compatible with the latest version of XML + Schema itself, or with the XML namespace itself. In other words, + if the XML Schema or XML namespaces change, the version of this + document at + http://www.w3.org/2001/xml.xsd + + will change accordingly; the version at + + http://www.w3.org/2009/01/xml.xsd + + will not change. +

+

+ Previous dated (and unchanging) versions of this schema + document are at: +

+ +
+
+
+
+ +
+ diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/fhir-spring-test-config.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/fhir-spring-test-config.xml new file mode 100644 index 00000000000..b761e8b75dd --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/fhir-spring-test-config.xml @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/fhir_jpatest_persistence.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/fhir_jpatest_persistence.xml new file mode 100644 index 00000000000..cd25b565b8d --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/fhir_jpatest_persistence.xml @@ -0,0 +1,40 @@ + + + + + org.hibernate.ejb.HibernatePersistence + ca.uhn.test.jpasrv.PatientResourceTable + ca.uhn.fhir.jpa.entity.ResourceHistoryTable + ca.uhn.fhir.jpa.entity.ResourceHistoryTag + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamDate + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamNumber + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamString + ca.uhn.fhir.jpa.entity.ResourceIndexedSearchParamToken + ca.uhn.fhir.jpa.entity.ResourceLink + ca.uhn.fhir.jpa.entity.ResourceTable + ca.uhn.fhir.jpa.entity.ResourceTag + + true + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/logback.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/logback.xml new file mode 100644 index 00000000000..8da72a0e285 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/logback.xml @@ -0,0 +1,16 @@ + + + + + INFO + + + %d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{36} [%file:%line] %msg%n + + + + + + + + \ No newline at end of file diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-a.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-a.xml new file mode 100644 index 00000000000..b271d272043 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-a.xml @@ -0,0 +1,64 @@ + + + + + +
+

Patient Donald DUCK @ Acme Healthcare, Inc. MR = 654321

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-animal.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-animal.xml new file mode 100644 index 00000000000..a0b6191675b --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-animal.xml @@ -0,0 +1,108 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + +
IdKenzi (Dog: Golden Retriever)
OwnerPeter Chalmers, 534 Erewhon, Pleasantville, Vic, 3999
ContactsWork: (03) 5555 6473
IdDog Tag: 1234123 (Maroondah City Council)
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-b.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-b.xml new file mode 100644 index 00000000000..00a4d351077 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-b.xml @@ -0,0 +1,60 @@ + + + + + +
+

Patient Donald D DUCK @ Acme Healthcare, Inc. MR = 123456

+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-dicom.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-dicom.xml new file mode 100644 index 00000000000..ae5b1dff732 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-dicom.xml @@ -0,0 +1,53 @@ + + + + + + + + + + + + + + + + + + + + + + +
Patient MINT_TEST, ID = MINT1234. Age = 56y, Size = + 1.83m, Weight = 72.58kg
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-f001-pieter.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-f001-pieter.xml new file mode 100644 index 00000000000..48e1631d974 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-f001-pieter.xml @@ -0,0 +1,89 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-f201-roel.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-f201-roel.xml new file mode 100644 index 00000000000..ef291a771ec --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-f201-roel.xml @@ -0,0 +1,121 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-ihe-pcd.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-ihe-pcd.xml new file mode 100644 index 00000000000..fcfa0c3124f --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-ihe-pcd.xml @@ -0,0 +1,24 @@ + + + + + +
Albert Brooks, Id: AB60001
+
+ + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-us-extensions.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-us-extensions.xml new file mode 100644 index 00000000000..7c50f10a43d --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-us-extensions.xml @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +
NamePeter James Chalmers ("Jim")
Address534 Erewhon, Pleasantville, Orange County, 3999
ContactsHome: unknown. Work: (03) 5555 6473
IdMRN: 12345 (Acme Healthcare)
+
+
+ + + + + + + + + +
+ + + + + + + + +
+ + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-xcda.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-xcda.xml new file mode 100644 index 00000000000..61a5318779c --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-xcda.xml @@ -0,0 +1,32 @@ + + + + +
+

Henry Levin the 7th

+
+
+ + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-xds.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-xds.xml new file mode 100644 index 00000000000..5ff8be89f60 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example-xds.xml @@ -0,0 +1,38 @@ + + + + +
+

Patient John Doe, M, 27-May 1956. ID: 89765a87b

+
+
+ + + + + + + + + + + + + + +
+ + + + + +
+ + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example.xml new file mode 100644 index 00000000000..bca3f290246 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/patient-example.xml @@ -0,0 +1,116 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + +
NamePeter James Chalmers ("Jim")
Address534 Erewhon, Pleasantville, Vic, 3999
ContactsHome: unknown. Work: (03) 5555 6473
IdMRN: 12345 (Acme Healthcare)
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example-bluebook.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example-bluebook.xml new file mode 100644 index 00000000000..7c4c41d2f70 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example-bluebook.xml @@ -0,0 +1,95 @@ + + + + +
+
+        Cathy Jones, female. Birth weight 3.25 kg at 44.3 cm. 
+        Injection of Vitamin K given on 1972-11-30 (first dose) and 1972-12-11 (second dose)
+        Note: Was able to speak Chinese at birth.
+      
+
+
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example-f201-lifelines.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example-f201-lifelines.xml new file mode 100644 index 00000000000..36a72117608 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example-f201-lifelines.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + diff --git a/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example.xml b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example.xml new file mode 100644 index 00000000000..409795045e2 --- /dev/null +++ b/hapi-fhir-jpaserver-uhnfhirtest/src/test/resources/resources/questionnaire-example.xml @@ -0,0 +1,200 @@ + + + +
+
+            Comorbidity? YES
+              Cardial Comorbidity? YES
+                Angina? YES
+                MI? NO
+              Vascular Comorbidity?
+                (no answers)
+              ...
+            Histopathology
+              Abdominal
+                pT category: 1a
+              ...
+          
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
diff --git a/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm b/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm index 6f24cd98947..87161c519b3 100644 --- a/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm +++ b/hapi-tinder-plugin/src/main/resources/vm/jpa_resource_provider.vm @@ -5,7 +5,7 @@ import java.util.*; import org.apache.commons.lang3.StringUtils; -import ca.uhn.fhir.jpa.provider.BaseJpaResourceProvider; +import ca.uhn.fhir.jpa.provider.JpaResourceProvider; import ca.uhn.fhir.jpa.dao.SearchParameterMap; import ca.uhn.fhir.model.api.*; import ca.uhn.fhir.model.api.annotation.*; @@ -15,7 +15,7 @@ import ca.uhn.fhir.rest.annotation.*; import ca.uhn.fhir.rest.param.*; -public class ${className}ResourceProvider extends BaseJpaResourceProvider<${className}> { +public class ${className}ResourceProvider extends JpaResourceProvider<${className}> { @Override public Class getResourceType() {