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); }
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++) { BundleEntryComponent be = bt.addEntry();
@Override public void addRootPropertiesToBundle(String theId, String theServerBase, String theLinkSelf, String theLinkPrev, String theLinkNext, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType<Date> theLastUpdated) { ensureBundle(); myBase = theServerBase; if (myBundle.getIdElement().isEmpty()) { myBundle.setId(theId); } if (myBundle.getIdElement().isEmpty()) { myBundle.setId(UUID.randomUUID().toString()); } if (myBundle.getMeta().getLastUpdated() == null && theLastUpdated != null) { myBundle.getMeta().getLastUpdatedElement().setValueAsString(theLastUpdated.getValueAsString()); } if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkSelf)) { myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theLinkSelf); } if (!hasLink(Constants.LINK_NEXT, myBundle) && isNotBlank(theLinkNext)) { myBundle.addLink().setRelation(Constants.LINK_NEXT).setUrl(theLinkNext); } if (!hasLink(Constants.LINK_PREVIOUS, myBundle) && isNotBlank(theLinkPrev)) { myBundle.addLink().setRelation(Constants.LINK_PREVIOUS).setUrl(theLinkPrev); } if (myBundle.getTypeElement().isEmpty() && theBundleType != null) { myBundle.getTypeElement().setValueAsString(theBundleType.getCode()); } if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) { myBundle.getTotalElement().setValue(theTotalResults); } }
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"); }
myBundle = new Bundle(); myBundle.setId(UUID.randomUUID().toString());
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); }
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++) { BundleEntryComponent be = bt.addEntry();
@Override public void addRootPropertiesToBundle(String theId, String theServerBase, String theLinkSelf, String theLinkPrev, String theLinkNext, Integer theTotalResults, BundleTypeEnum theBundleType, IPrimitiveType<Date> theLastUpdated) { ensureBundle(); myBase = theServerBase; if (myBundle.getIdElement().isEmpty()) { myBundle.setId(theId); } if (myBundle.getIdElement().isEmpty()) { myBundle.setId(UUID.randomUUID().toString()); } if (myBundle.getMeta().getLastUpdated() == null && theLastUpdated != null) { myBundle.getMeta().getLastUpdatedElement().setValueAsString(theLastUpdated.getValueAsString()); } if (!hasLink(Constants.LINK_SELF, myBundle) && isNotBlank(theLinkSelf)) { myBundle.addLink().setRelation(Constants.LINK_SELF).setUrl(theLinkSelf); } if (!hasLink(Constants.LINK_NEXT, myBundle) && isNotBlank(theLinkNext)) { myBundle.addLink().setRelation(Constants.LINK_NEXT).setUrl(theLinkNext); } if (!hasLink(Constants.LINK_PREVIOUS, myBundle) && isNotBlank(theLinkPrev)) { myBundle.addLink().setRelation(Constants.LINK_PREVIOUS).setUrl(theLinkPrev); } if (myBundle.getTypeElement().isEmpty() && theBundleType != null) { myBundle.getTypeElement().setValueAsString(theBundleType.getCode()); } if (myBundle.getTotalElement().isEmpty() && theTotalResults != null) { myBundle.getTotalElement().setValue(theTotalResults); } }
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"); }
myBundle = new Bundle(); myBundle.setId(UUID.randomUUID().toString());