FIx issue uploading US Core resources

This commit is contained in:
jamesagnew 2019-08-17 18:11:52 -04:00
parent ab5333f370
commit 54657214de
4 changed files with 1715 additions and 0 deletions

View File

@ -132,6 +132,9 @@ public abstract class BaseJpaDstu2Test extends BaseJpaTest {
@Qualifier("myPatientDaoDstu2")
protected IFhirResourceDaoPatient<Patient> myPatientDao;
@Autowired
@Qualifier("myConformanceDaoDstu2")
protected IFhirResourceDao<Conformance> myConformanceDao;
@Autowired
@Qualifier("myGroupDaoDstu2")
protected IFhirResourceDao<Group> myGroupDao;
@Autowired

View File

@ -6,6 +6,7 @@ import ca.uhn.fhir.model.api.Tag;
import ca.uhn.fhir.model.api.TagList;
import ca.uhn.fhir.model.base.composite.BaseCodingDt;
import ca.uhn.fhir.model.dstu2.composite.CodingDt;
import ca.uhn.fhir.model.dstu2.resource.Conformance;
import ca.uhn.fhir.model.dstu2.resource.Organization;
import ca.uhn.fhir.model.dstu2.resource.Patient;
import ca.uhn.fhir.model.primitive.IdDt;
@ -18,6 +19,7 @@ import org.hl7.fhir.instance.model.api.IIdType;
import org.junit.AfterClass;
import org.junit.Test;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
@ -84,6 +86,18 @@ public class FhirResourceDaoDstu2UpdateTest extends BaseJpaDstu2Test {
myPatientDao.update(p, mySrd);
}
/**
* Make sure we can upload a real example resource from the DSTU2 argonaut example pack
*/
@Test
public void testUploadArgonautExampleConformance() throws IOException {
Conformance conformance = loadResourceFromClasspath(Conformance.class, "/dstu2/Conformance-server.json");
conformance.setId("");
myConformanceDao.create(conformance);
assertEquals(1, myConformanceDao.search(new SearchParameterMap().setLoadSynchronous(true)).size().intValue());
}
/**
* Per the spec, update should preserve tags and security labels but not profiles
*/

File diff suppressed because one or more lines are too long

View File

@ -46,6 +46,15 @@ public class LogicalReferenceHelper {
}
}
/*
* Account for common logical references
*/
if (theId.getValue().startsWith("http://fhir.org/guides/argonaut/")) {
return true;
}
return false;
}