Fix tests

This commit is contained in:
jamesagnew 2015-10-06 09:08:25 -04:00
parent 3d330de8ef
commit 50c43bdb29
5 changed files with 16 additions and 9 deletions

View File

@ -162,7 +162,7 @@ public abstract class BaseHapiFhirResourceDao<T extends IResource> extends BaseH
private Class<T> myResourceType;
private String mySecondaryPrimaryKeyParamName;
@Autowired
@Autowired()
private ISearchResultDao mySearchResultDao;
private Set<Long> addPredicateComposite(RuntimeSearchParam theParamDef, Set<Long> thePids, List<? extends IQueryParameterType> theNextAnd) {
@ -1784,11 +1784,11 @@ public abstract class BaseHapiFhirResourceDao<T extends IResource> extends BaseH
List<ResourceLink> results = q.getResultList();
for (ResourceLink resourceLink : results) {
if (theReverseMode) {
if (theEverythingModeEnum.isEncounter()) {
if (resourceLink.getSourcePath().equals("Encounter.subject") || resourceLink.getSourcePath().equals("Encounter.patient")) {
nextRoundOmit.add(resourceLink.getSourceResourcePid());
}
}
// if (theEverythingModeEnum.isEncounter()) {
// if (resourceLink.getSourcePath().equals("Encounter.subject") || resourceLink.getSourcePath().equals("Encounter.patient")) {
// nextRoundOmit.add(resourceLink.getSourceResourcePid());
// }
// }
pidsToInclude.add(resourceLink.getSourceResourcePid());
} else {
pidsToInclude.add(resourceLink.getTargetResourcePid());
@ -2154,8 +2154,8 @@ public abstract class BaseHapiFhirResourceDao<T extends IResource> extends BaseH
CriteriaQuery<Tuple> cq = builder.createTupleQuery();
Root<ResourceTable> from = cq.from(ResourceTable.class);
List<Predicate> predicates = new ArrayList<Predicate>();
if (theParams.get(BaseResource.RES_ID) != null) {
StringParam idParm = (StringParam) theParams.get(BaseResource.RES_ID).get(0).get(0);
if (theParams.get(BaseResource.SP_RES_ID) != null) {
StringParam idParm = (StringParam) theParams.get(BaseResource.SP_RES_ID).get(0).get(0);
predicates.add(builder.equal(from.get("myId"), idParm.getValue()));
}
predicates.add(builder.equal(from.get("myResourceType"), myResourceName));

View File

@ -678,6 +678,8 @@ public class FhirSystemDaoDstu2Test extends BaseJpaDstu2Test {
@Test
public void testTransactionDeleteMatchUrlWithTwoMatch() {
myDaoConfig.setAllowMultipleDelete(false);
String methodName = "testTransactionDeleteMatchUrlWithTwoMatch";
Patient p = new Patient();

View File

@ -771,6 +771,8 @@ public class ResourceProviderDstu2Test extends BaseResourceProviderDstu2Test {
obs.getEncounter().setReference(encId);
IIdType obsId = ourClient.create().resource(obs).execute().getId().toUnqualifiedVersionless();
ourLog.info("IDs: EncU:" + encUId.getIdPart() + " Enc:" + encId.getIdPart() + " " + patientId.toUnqualifiedVersionless());
Parameters output = ourClient.operation().onInstance(encId).named("everything").withNoParameters(Parameters.class).execute();
ca.uhn.fhir.model.dstu2.resource.Bundle b = (ca.uhn.fhir.model.dstu2.resource.Bundle) output.getParameterFirstRep().getResource();
List<IIdType> ids = toUnqualifiedVersionlessIds(b);

View File

@ -22,6 +22,8 @@
<class>ca.uhn.fhir.jpa.entity.ResourceTag</class>
<class>ca.uhn.fhir.jpa.entity.SubscriptionTable</class>
<class>ca.uhn.fhir.jpa.entity.SubscriptionFlaggedResource</class>
<class>ca.uhn.fhir.jpa.entity.Search</class>
<class>ca.uhn.fhir.jpa.entity.SearchResult</class>
<class>ca.uhn.fhir.jpa.entity.TagDefinition</class>
<exclude-unlisted-classes>true</exclude-unlisted-classes>

View File

@ -23,9 +23,10 @@
<property name="dao" ref="mySystemDao${versionCapitalized}"/>
</bean>
<jpa:repositories base-package="ca.uhn.fhir.jpa.dao.data" />
#if ( ${versionCapitalized} == 'Dstu2' )
<bean id="myFhirContextDstu2Hl7Org" class="ca.uhn.fhir.context.FhirContext" factory-method="forDstu2Hl7Org"/>
<jpa:repositories base-package="ca.uhn.fhir.jpa.dao.data" />
<task:annotation-driven executor="myExecutor" scheduler="myScheduler"/>
<task:executor id="myExecutor" pool-size="5"/>