use of org.hl7.fhir.r4.model.Bundle.BundleLinkComponent in project org.hl7.fhir.core by hapifhir.
the class Bundle method copy.
public Bundle copy() {
Bundle dst = new Bundle();
copyValues(dst);
dst.type = type == null ? null : type.copy();
dst.total = total == null ? null : total.copy();
if (link != null) {
dst.link = new ArrayList<BundleLinkComponent>();
for (BundleLinkComponent i : link) dst.link.add(i.copy());
}
;
if (entry != null) {
dst.entry = new ArrayList<BundleEntryComponent>();
for (BundleEntryComponent i : entry) dst.entry.add(i.copy());
}
;
dst.signature = signature == null ? null : signature.copy();
return dst;
}
use of org.hl7.fhir.r4.model.Bundle.BundleLinkComponent in project org.hl7.fhir.core by hapifhir.
the class Bundle method copy.
public Bundle copy() {
Bundle dst = new Bundle();
copyValues(dst);
dst.type = type == null ? null : type.copy();
dst.total = total == null ? null : total.copy();
if (link != null) {
dst.link = new ArrayList<BundleLinkComponent>();
for (BundleLinkComponent i : link) dst.link.add(i.copy());
}
;
if (entry != null) {
dst.entry = new ArrayList<BundleEntryComponent>();
for (BundleEntryComponent i : entry) dst.entry.add(i.copy());
}
;
dst.signature = signature == null ? null : signature.copy();
return dst;
}
use of org.hl7.fhir.r4.model.Bundle.BundleLinkComponent in project org.hl7.fhir.core by hapifhir.
the class GraphQLEngineTests method search.
@Override
public Bundle search(Object appInfo, String type, List<Argument> searchParams) throws FHIRException {
try {
Bundle bnd = new Bundle();
BundleLinkComponent bl = bnd.addLink();
bl.setRelation("next");
bl.setUrl("http://test.fhir.org/r4/Patient?_format=text/xhtml&search-id=77c97e03-8a6c-415f-a63d-11c80cf73f&&active=true&_sort=_id&search-offset=50&_count=50");
bl = bnd.addLink();
bl.setRelation("self");
bl.setUrl("http://test.fhir.org/r4/Patient?_format=text/xhtml&search-id=77c97e03-8a6c-415f-a63d-11c80cf73f&&active=true&_sort=_id&search-offset=0&_count=50");
BundleEntryComponent be = bnd.addEntry();
be.setFullUrl("http://hl7.org/fhir/Patient/example");
be.setResource(new XmlParser().parse(new FileInputStream(Utilities.path(TestingUtilities.resourceNameToFile("patient-example.xml")))));
be = bnd.addEntry();
be.setFullUrl("http://hl7.org/fhir/Patient/example");
be.setResource(new XmlParser().parse(new FileInputStream(Utilities.path(TestingUtilities.resourceNameToFile("patient-example-xds.xml")))));
be.getSearch().setScore(0.5);
be.getSearch().setMode(SearchEntryMode.MATCH);
bnd.setTotal(50);
return bnd;
} catch (Exception e) {
throw new FHIRException(e);
}
}
use of org.hl7.fhir.r4.model.Bundle.BundleLinkComponent in project geoprism-registry by terraframe.
the class FhirResourceImporter method synchronize.
public void synchronize() {
this.processor.configure(this.connection.getExternalSystem());
IGenericClient client = this.connection.getClient();
Bundle bundle = client.search().forResource(Location.class).count(2000).lastUpdated(new DateRangeParam(this.since, null)).include(new Include("Location:organization")).returnBundle(Bundle.class).execute();
this.history.appLock();
this.history.setWorkTotal(Long.valueOf(bundle.getTotal() * 2));
this.history.apply();
while (bundle != null) {
this.process(bundle);
BundleLinkComponent link = bundle.getLink(Bundle.LINK_NEXT);
if (link != null) {
// The link may come back with the local url instead of the global url
// As such replace the base local url with the base global url
// String localUrl = link.getUrl();
// String[] split = localUrl.split("\\?");
// String globalUrl = this.connection.getExternalSystem().getUrl() + "?"
// + split[1];
//
// link.setUrl(globalUrl);
//
bundle = client.loadPage().next(bundle).execute();
} else {
bundle = null;
}
}
}
use of org.hl7.fhir.r4.model.Bundle.BundleLinkComponent in project org.hl7.fhir.core by hapifhir.
the class GraphQLEngineTests method search.
@Override
public Bundle search(Object appInfo, String type, List<Argument> searchParams) throws FHIRException {
try {
Bundle bnd = new Bundle();
BundleLinkComponent bl = bnd.addLink();
bl.setRelation("next");
bl.setUrl("http://test.fhir.org/r4/Patient?_format=text/xhtml&search-id=77c97e03-8a6c-415f-a63d-11c80cf73f&&active=true&_sort=_id&search-offset=50&_count=50");
bl = bnd.addLink();
bl.setRelation("self");
bl.setUrl("http://test.fhir.org/r4/Patient?_format=text/xhtml&search-id=77c97e03-8a6c-415f-a63d-11c80cf73f&&active=true&_sort=_id&search-offset=0&_count=50");
BundleEntryComponent be = bnd.addEntry();
be.setFullUrl("http://hl7.org/fhir/Patient/example");
be.setResource(new XmlParser().parse(TestingUtilities.loadTestResourceStream("r5", "patient-example.xml")));
be = bnd.addEntry();
be.setFullUrl("http://hl7.org/fhir/Patient/example");
be.setResource(new XmlParser().parse(TestingUtilities.loadTestResourceStream("r5", "patient-example-xds.xml")));
be.getSearch().setScore(0.5);
be.getSearch().setMode(SearchEntryMode.MATCH);
bnd.setTotal(50);
return bnd;
} catch (Exception e) {
throw new FHIRException(e);
}
}
Aggregations