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; }
while (c < end) { Bundle bt = new Bundle(); bt.setType(BundleType.BATCH); bt.setId(UUID.randomUUID().toString().toLowerCase()); for (int i = c; i < Math.min(b.getEntry().size(), c+size); i++) {
bundle.setType(org.hl7.fhir.r4.model.Bundle.BundleType.TRANSACTION);
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 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; }
Bundle bundle = new Bundle().setType(Bundle.BundleType.DOCUMENT); for (IBaseResource resource : resourceList) { bundle.addEntry(new Bundle.BundleEntryComponent().setResource((Resource) resource));
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; }
while (c < end) { Bundle bt = new Bundle(); bt.setType(BundleType.BATCH); bt.setId(UUID.randomUUID().toString().toLowerCase()); for (int i = c; i < Math.min(b.getEntry().size(), c+size); i++) {
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 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; }
Bundle bundle = new Bundle().setType(Bundle.BundleType.DOCUMENT); for (IBaseResource resource : resourceList) { bundle.addEntry(new Bundle.BundleEntryComponent().setResource((Resource) resource));