@Override public void addEntry(Bundle theBundle, Bundle.BundleEntryComponent theEntry) { theBundle.addEntry(theEntry); }
@Override public Bundle.BundleEntryComponent addEntry(Bundle theBundle) { return theBundle.addEntry(); }
/** * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist */ public BundleEntryComponent getEntryFirstRep() { if (getEntry().isEmpty()) { addEntry(); } return getEntry().get(0); }
private static void LoadZipFile(String server, String file, IParser p, int size, int start, int end) throws IOException, Exception { System.out.println("Load Zip file "+file); Bundle b = new Bundle(); b.setType(BundleType.COLLECTION); b.setId(UUID.randomUUID().toString().toLowerCase()); ZipInputStream zip = new ZipInputStream(new FileInputStream(file)); ZipEntry entry; while((entry = zip.getNextEntry())!=null) { try { Resource r = p.parse(zip); b.addEntry().setResource(r); } catch (Exception e) { throw new Exception("Error parsing "+entry.getName()+": "+e.getMessage(), e); } } loadBundle(server, b, size, start, end); }
@Override public Base addChild(String name) throws FHIRException { if (name.equals("identifier")) { this.identifier = new Identifier(); return this.identifier; } else if (name.equals("type")) { throw new FHIRException("Cannot call addChild on a primitive type Bundle.type"); } else if (name.equals("timestamp")) { throw new FHIRException("Cannot call addChild on a primitive type Bundle.timestamp"); } else if (name.equals("total")) { throw new FHIRException("Cannot call addChild on a primitive type Bundle.total"); } else if (name.equals("link")) { return addLink(); } else if (name.equals("entry")) { return addEntry(); } else if (name.equals("signature")) { this.signature = new Signature(); return this.signature; } else return super.addChild(name); }
bt.setId(UUID.randomUUID().toString().toLowerCase()); for (int i = c; i < Math.min(b.getEntry().size(), c+size); i++) { BundleEntryComponent be = bt.addEntry(); be.setResource(b.getEntry().get(i).getResource()); be.getRequest().setMethod(HTTPVerb.PUT);
org.hl7.fhir.r4.model.Bundle.BundleEntryComponent entry = bundle.addEntry(); entry.getRequest().setMethod(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); entry.setResource((org.hl7.fhir.r4.model.Resource) nextResource); continue; org.hl7.fhir.r4.model.Bundle.BundleEntryComponent entry = bundle.addEntry(); entry.getRequest().setMethod(org.hl7.fhir.r4.model.Bundle.HTTPVerb.POST); entry.setResource((org.hl7.fhir.r4.model.Resource) parsed);
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return getIdentifier(); case 3575610: return getTypeElement(); case 55126294: return getTimestampElement(); case 110549828: return getTotalElement(); case 3321850: return addLink(); case 96667762: return addEntry(); case 1073584312: return getSignature(); default: return super.makeProperty(hash, name); } }
@Override public void addEntry(Bundle theBundle, Bundle.BundleEntryComponent theEntry) { theBundle.addEntry(theEntry); }
@Override public Bundle.BundleEntryComponent addEntry(Bundle theBundle) { return theBundle.addEntry(); }
BundleEntryComponent entry = myBundle.addEntry().setResource(next); if (next.getIdElement().hasBaseUrl()) { entry.setFullUrl(next.getId()); BundleEntryComponent entry = myBundle.addEntry(); entry.setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE); if (next.getIdElement().hasBaseUrl()) {
BundleEntryComponent entry = myBundle.addEntry().setResource((Resource) next); Resource nextAsResource = (Resource) next; IIdType id = populateBundleEntryFullUrl(next, entry); BundleEntryComponent entry = myBundle.addEntry(); entry.setResource((Resource) next).getSearch().setMode(SearchEntryMode.INCLUDE); populateBundleEntryFullUrl(next, entry);
public org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.instance.model.Bundle src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); copyResource(src, tgt); tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); for (org.hl7.fhir.instance.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); for (org.hl7.fhir.instance.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); tgt.setSignature(convertSignature(src.getSignature())); return tgt; }
public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.dstu2016may.model.Bundle src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); copyResource(src, tgt); tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); tgt.setSignature(convertSignature(src.getSignature())); return tgt; }
for (IBaseResource nextBaseRes : theResources) { Resource next = (Resource) nextBaseRes; BundleEntryComponent nextEntry = myBundle.addEntry();
/** * @return The first repetition of repeating field {@link #entry}, creating it if it does not already exist */ public BundleEntryComponent getEntryFirstRep() { if (getEntry().isEmpty()) { addEntry(); } return getEntry().get(0); }
Bundle bundle = new Bundle().setType(Bundle.BundleType.DOCUMENT); for (IBaseResource resource : resourceList) { bundle.addEntry(new Bundle.BundleEntryComponent().setResource((Resource) resource));
/** * Returns a bundle containing all resources in the dataset. This should be used * with caution for large datasets, since the returned bundle will include all data. * * @param dataset a dataset of FHIR resoruces * @return a bundle containing those resources. */ public static Bundle toBundle(Dataset<? extends Resource> dataset) { List<Resource> resources = (List<Resource>) dataset.collectAsList(); Bundle bundle = new Bundle(); for (Resource resource : resources) { bundle.addEntry().setResource(resource); } return bundle; }
@Override public Base makeProperty(int hash, String name) throws FHIRException { switch (hash) { case -1618432855: return getIdentifier(); case 3575610: return getTypeElement(); case 55126294: return getTimestampElement(); case 110549828: return getTotalElement(); case 3321850: return addLink(); case 96667762: return addEntry(); case 1073584312: return getSignature(); default: return super.makeProperty(hash, name); } }
public static org.hl7.fhir.r4.model.Bundle convertBundle(org.hl7.fhir.dstu2016may.model.Bundle src) throws FHIRException { if (src == null || src.isEmpty()) return null; org.hl7.fhir.r4.model.Bundle tgt = new org.hl7.fhir.r4.model.Bundle(); copyResource(src, tgt); tgt.setType(convertBundleType(src.getType())); if (src.hasTotal()) tgt.setTotal(src.getTotal()); for (org.hl7.fhir.dstu2016may.model.Bundle.BundleLinkComponent t : src.getLink()) tgt.addLink(convertBundleLinkComponent(t)); for (org.hl7.fhir.dstu2016may.model.Bundle.BundleEntryComponent t : src.getEntry()) tgt.addEntry(convertBundleEntryComponent(t)); tgt.setSignature(convertSignature(src.getSignature())); return tgt; }