private void ensureBundle() { if (myBundle == null) { myBundle = new Bundle(); } }
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 Bundle createBundle(String theBundleType) { Bundle resp = new Bundle(); try { resp.setType(Bundle.BundleType.fromCode(theBundleType)); } catch (FHIRException theE) { throw new InternalErrorException("Unknown bundle type: " + theBundleType); } return resp; }
public Bundle copy() { Bundle dst = new Bundle(); copyValues(dst); dst.identifier = identifier == null ? null : identifier.copy(); dst.type = type == null ? null : type.copy(); dst.timestamp = timestamp == null ? null : timestamp.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; }
end = b.getEntry().size(); while (c < end) { Bundle bt = new Bundle(); bt.setType(BundleType.BATCH); bt.setId(UUID.randomUUID().toString().toLowerCase());
@SuppressWarnings("unchecked") private org.hl7.fhir.r4.model.Bundle getBundleFromFileR4(Integer limit, File inputFile, FhirContext ctx) throws IOException, UnsupportedEncodingException { org.hl7.fhir.r4.model.Bundle bundle = new org.hl7.fhir.r4.model.Bundle(); bundle.setType(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION);
return new DetectedIssue(); if ("Bundle".equals(name)) return new Bundle(); if ("CompartmentDefinition".equals(name)) return new CompartmentDefinition();
private void ensureBundle() { if (myBundle == null) { myBundle = new Bundle(); } }
public Bundle process(String sourceFile) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException { this.definitions = sourceFile; log("Begin. Produce Loinc CDEs in "+dest+" from "+definitions); loadLoinc(); log("LOINC loaded"); now = DateTimeType.now(); bundle = new Bundle(); bundle.setType(BundleType.COLLECTION); bundle.setId("http://hl7.org/fhir/commondataelement/loinc"); bundle.setMeta(new Meta().setLastUpdatedElement(InstantType.now())); processLoincCodes(); return bundle; }
public void process() throws FHIRFormatError, IOException, XmlPullParserException, SAXException, ParserConfigurationException { log("Begin. Produce Loinc CDEs in "+dest+" from "+definitions); loadLoinc(); log("LOINC loaded"); now = DateTimeType.now(); bundle = new Bundle(); bundle.setId("http://hl7.org/fhir/commondataelement/loinc"); bundle.setMeta(new Meta().setLastUpdatedElement(InstantType.now())); processLoincCodes(); if (dest != null) { log("Saving..."); saveBundle(); } log("Done"); }
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; }
@Override public void initializeBundleFromResourceList(String theAuthor, List<? extends IBaseResource> theResources, String theServerBase, String theCompleteUrl, int theTotalResults, BundleTypeEnum theBundleType) { myBundle = new Bundle();
Bundle bundle = new Bundle().setType(Bundle.BundleType.DOCUMENT); for (IBaseResource resource : resourceList) { bundle.addEntry(new Bundle.BundleEntryComponent().setResource((Resource) resource));
@Override public Bundle createBundle(String theBundleType) { Bundle resp = new Bundle(); try { resp.setType(Bundle.BundleType.fromCode(theBundleType)); } catch (FHIRException theE) { throw new InternalErrorException("Unknown bundle type: " + theBundleType); } return resp; }
public Bundle process(String sourceFile) throws FileNotFoundException, SAXException, IOException, ParserConfigurationException { this.definitions = sourceFile; log("Begin. Produce Loinc CDEs in "+dest+" from "+definitions); loadLoinc(); log("LOINC loaded"); now = DateTimeType.now(); bundle = new Bundle(); bundle.setType(BundleType.COLLECTION); bundle.setId("http://hl7.org/fhir/commondataelement/loinc"); bundle.setMeta(new Meta().setLastUpdatedElement(InstantType.now())); processLoincCodes(); return bundle; }
public void process() throws FHIRFormatError, IOException, XmlPullParserException, SAXException, ParserConfigurationException { log("Begin. Produce Loinc CDEs in "+dest+" from "+definitions); loadLoinc(); log("LOINC loaded"); now = DateTimeType.now(); bundle = new Bundle(); bundle.setId("http://hl7.org/fhir/commondataelement/loinc"); bundle.setMeta(new Meta().setLastUpdatedElement(InstantType.now())); processLoincCodes(); if (dest != null) { log("Saving..."); saveBundle(); } log("Done"); }
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; }
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; }
case -310041824: return new BiologicallyDerivedProduct(); case -202769967: return new BodyStructure(); case 2000952482: return new Bundle(); case -871422185: return new CapabilityStatement(); case 57208314: return new CarePlan();