Search in sources :

Example 6 with BundleLinkComponent

use of org.hl7.fhir.r5.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.identifier = identifier == null ? null : identifier.copy();
    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;
}
Also used : IBaseBundle(org.hl7.fhir.instance.model.api.IBaseBundle)

Example 7 with BundleLinkComponent

use of org.hl7.fhir.r5.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("r4b", "patient-example.xml")));
        be = bnd.addEntry();
        be.setFullUrl("http://hl7.org/fhir/Patient/example");
        be.setResource(new XmlParser().parse(TestingUtilities.loadTestResourceStream("r4b", "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);
    }
}
Also used : XmlParser(org.hl7.fhir.r4b.formats.XmlParser) BundleEntryComponent(org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent) Bundle(org.hl7.fhir.r4b.model.Bundle) FHIRException(org.hl7.fhir.exceptions.FHIRException) IOException(java.io.IOException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException) SAXException(org.xml.sax.SAXException) FHIRException(org.hl7.fhir.exceptions.FHIRException) BundleLinkComponent(org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent)

Aggregations

IOException (java.io.IOException)3 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)3 FHIRException (org.hl7.fhir.exceptions.FHIRException)3 IBaseBundle (org.hl7.fhir.instance.model.api.IBaseBundle)3 SAXException (org.xml.sax.SAXException)3 Bundle (org.hl7.fhir.r4.model.Bundle)2 BundleLinkComponent (org.hl7.fhir.r4.model.Bundle.BundleLinkComponent)2 Include (ca.uhn.fhir.model.api.Include)1 IGenericClient (ca.uhn.fhir.rest.client.api.IGenericClient)1 DateRangeParam (ca.uhn.fhir.rest.param.DateRangeParam)1 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 XmlParser (org.hl7.fhir.r4.formats.XmlParser)1 BundleEntryComponent (org.hl7.fhir.r4.model.Bundle.BundleEntryComponent)1 Location (org.hl7.fhir.r4.model.Location)1 XmlParser (org.hl7.fhir.r4b.formats.XmlParser)1 Bundle (org.hl7.fhir.r4b.model.Bundle)1 BundleEntryComponent (org.hl7.fhir.r4b.model.Bundle.BundleEntryComponent)1 BundleLinkComponent (org.hl7.fhir.r4b.model.Bundle.BundleLinkComponent)1 XmlParser (org.hl7.fhir.r5.formats.XmlParser)1