当前位置: 首页>>代码示例>>Java>>正文


Java TimeTool.isAfter方法代码示例

本文整理汇总了Java中ch.rgw.tools.TimeTool.isAfter方法的典型用法代码示例。如果您正苦于以下问题:Java TimeTool.isAfter方法的具体用法?Java TimeTool.isAfter怎么用?Java TimeTool.isAfter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ch.rgw.tools.TimeTool的用法示例。


在下文中一共展示了TimeTool.isAfter方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLastSequenceDate

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public static String getLastSequenceDate(final Patient pat) {
	Query<Tracker> qbe = new Query<Tracker>(Tracker.class);
	qbe.add("PatientID", "=", pat.getId());
	qbe.add("ParentID", "=", "NIL");
	List<Tracker> list = qbe.execute();
	if (list.size() > 0) {
		Tracker ret = list.get(0);
		if (list.size() > 1) {
			TimeTool lastDate = new TimeTool(
					TimeTool.BEGINNING_OF_UNIX_EPOCH);
			TimeTool cmp = new TimeTool();
			for (Tracker tracker : list) {
				cmp.set(tracker.get("Datum"));
				// System.out.println(cmp.dump());
				// System.out.println(lastDate.dump());
				if (cmp.isAfter(lastDate)) {
					lastDate.set(cmp);
					ret = tracker;
				}
			}
		}
		return ret.getDate();
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:26,代码来源:Tracker.java

示例2: getLatestLabResult

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
private LabResult getLatestLabResult(String name, List<LabResult> list){
	TimeTool ttLabResult = new TimeTool();
	LabResult labResult = null;
	if (list != null && name != null) {
		for (LabResult result : list) {
			String label = result.getItem().getName();
			if (name.equals(label)) {
				if (labResult == null) {
					labResult = result;
					ttLabResult.setDate(labResult.getDate());
				} else {
					if (result.getDate() != null) {
						TimeTool ttResult = new TimeTool();
						ttResult.setDate(result.getDate());
						if (ttResult.isAfter(ttLabResult)) {
							ttLabResult = ttResult;
							labResult = result;
						}
					}
				}
			}
		}
	}
	return labResult;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:26,代码来源:DocboxHospitalReferralAction.java

示例3: medikarteDatum

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * Datum der letzten Aenderung der Medikarte (letztes von oder bis datum)
 */
public static String medikarteDatum(Patient patient)
{
	// TODO: Koennte man mit einer Query sauberer loesen
	List<Prescription> medis = medikarteMedikation(patient, false);
	TimeTool max = new TimeTool(0);
	TimeTool cur = new TimeTool();
	for (Prescription p: medis) {
		cur.set(p.getBeginDate());
		if (cur.isAfter(max)) max.set(p.getBeginDate());
		cur.set(p.getEndDate());
		if (cur.isAfter(max)) max.set(p.getEndDate());
	}
	
	return max.toString(TimeTool.DATE_GER);
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:19,代码来源:MedikarteHelpers.java

示例4: addToUnseen

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * add a LabResult to the list of unseen LabResults. We do not keep LabResults older than
 * KEEP_UNSEEN_LAB_RESULTS days in this list.
 */
public void addToUnseen(){
	List<LabResult> o = getUnseen();
	LinkedList<String> n = new LinkedList<String>();
	n.add(getId());
	TimeTool limit = new TimeTool();
	try { // We need to catch wrong formatted numbers in KEEP_UNSEEN
		limit.addHours(-24
			* Integer.parseInt(CoreHub.globalCfg.get(
				Preferences.LABSETTINGS_CFG_KEEP_UNSEEN_LAB_RESULTS,
				Preferences.DAYS_TO_KEEP_UNSEEN_LAB_RESULTS)));
	} catch (NumberFormatException nex) {
		ExHandler.handle(nex);
		limit.addHours(-24 * 7);
	}
	// log.log(limit.dump(),Log.INFOS);
	TimeTool tr = new TimeTool();
	for (LabResult lr : o) {
		//	log.info(lr.getDate());
		if (tr.set(lr.getDate())) {
			if (tr.isAfter(limit)) {
				n.add(lr.getId());
			}
		}
	}
	NamedBlob unseen = NamedBlob.load(LABRESULT_UNSEEN);
	String results = StringTool.join(n, ","); //$NON-NLS-1$
	unseen.putString(results);
	// unseen.set("lastupdate", new TimeTool().toString(TimeTool.TIMESTAMP));
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:34,代码来源:LabResult.java

示例5: isFixedMedication

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * 
 * @param rezeptId
 * @param dateUntil
 * @return
 * @since 3.1
 */
public boolean isFixedMedication(String rezeptId, String dateUntil){
	boolean rezeptIdIsNull = rezeptId.length() == 0;
	boolean dateIsNull = dateUntil.length() == 0;
	if (!dateIsNull) {
		TimeTool tt = new TimeTool(dateUntil);
		dateIsNull = tt.isAfter(new TimeTool());
	}
	return (rezeptIdIsNull & dateIsNull);
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:Prescription.java

示例6: loadBase

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
/**
 * Load the base Tracker for a given slot, patient and date
 * 
 * @param patient
 *            patient
 * @param date
 *            date of sequence. If null: Any sequence
 * @param slot
 *            image region
 * @return a Tracker for the requested patient and region. Might be null id
 *         no such tracker exists
 */
public static Tracker loadBase(final Patient patient, final String date,
		final int slot) {
	Query<Tracker> qbe = new Query<Tracker>(Tracker.class);
	qbe.add("PatientID", "=", patient.getId());
	qbe.add("slot", "=", Integer.toString(slot));
	qbe.add("ParentID", "=", "NIL");
	if (date != null) {
		qbe.add("Datum", "=", date);
	}
	List<Tracker> list = qbe.execute();
	if (list.size() > 0) {
		Tracker ret = list.get(0);
		if ((date == null) && (list.size() > 1)) {
			TimeTool lastDate = new TimeTool(
					TimeTool.BEGINNING_OF_UNIX_EPOCH);
			TimeTool cmp = new TimeTool();
			for (Tracker tracker : list) {
				cmp.set(tracker.get("Datum"));
				if (cmp.isAfter(lastDate)) {
					lastDate = cmp;
					ret = tracker;
				}
			}
		}
		return ret;
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:41,代码来源:Tracker.java

示例7: getLatestMap

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public static Map<String, String> getLatestMap(List<Map<String, String>> list){
	TimeTool currFrom = new TimeTool("19000101");
	TimeTool from = new TimeTool();
	Map<String, String> ret = null;
	for (Map<String, String> map : list) {
		from.set(map.get("GUELTIG_VON"));
		if (from.isAfter(currFrom)) {
			currFrom.set(from);
			ret = map;
		}
	}
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:14,代码来源:ImporterUtil.java

示例8: getLastKonsDate

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public static TimeTool getLastKonsDate(Rechnung rechnung){
	TimeTool ret = new TimeTool(TimeTool.BEGINNING_OF_UNIX_EPOCH);
	List<Konsultation> konsultationen = rechnung.getKonsultationen();
	for (Konsultation konsultation : konsultationen) {
		TimeTool tt = new TimeTool(konsultation.getDatum());
		if (tt.isAfter(ret)) {
			ret.set(tt);
		}
	}
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:12,代码来源:XMLExporterUtil.java

示例9: createContent

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
@Override
protected IStatus createContent(IProgressMonitor monitor){
	int totalwork = 1000000;
	monitor.beginTask(OFFENE_RECHNUNGEN_PER + getStichtag().toString(TimeTool.DATE_SIMPLE),
		totalwork);
	monitor.subTask(DATENBANKABFRAGE);
	Query<Rechnung> qbe = new Query<Rechnung>(Rechnung.class);
	qbe.add("RnDatum", "<=", getStichtag().toString(TimeTool.DATE_COMPACT)); //$NON-NLS-1$ //$NON-NLS-2$
	qbe.add("RnDatum", ">=", getStartTag().toString(TimeTool.DATE_COMPACT)); //$NON-NLS-1$ //$NON-NLS-2$
	if (bOnlyActiveMandator) {
		qbe.add("MandantID", "=", CoreHub.actMandant.getId()); //$NON-NLS-1$ //$NON-NLS-2$
	}
	List<Rechnung> rnn = qbe.execute();
	monitor.worked(1000);
	final ArrayList<Comparable<?>[]> result = new ArrayList<Comparable<?>[]>();
	int size = rnn.size();
	if (size == 0) {
		monitor.done();
		this.dataSet.setContent(result);
		return Status.OK_STATUS;
	}
	int step = totalwork / size;
	monitor.subTask(ANALYSIERE_RECHNUNGEN);
	TimeTool now = getStichtag();
	PatientIdFormatter pif = new PatientIdFormatter(8);
	for (Rechnung rn : rnn) {
		if (monitor.isCanceled()) {
			return Status.CANCEL_STATUS;
		}
		Fall fall = rn.getFall();
		if (fall != null) {
			Patient pat = fall.getPatient();
			Money betrag = rn.getBetrag();
			
			if ((pat != null) && (betrag != null) && (!betrag.isNeglectable())) {
				int status = rn.getStatusAtDate(now);
				if (RnStatus.isActive(status)) {
					Comparable[] row = new Comparable[this.getDataSet().getHeadings().size()];
					row[0] = pif.format(pat.get("PatientNr")); //$NON-NLS-1$
					row[1] = rn.getNr();
					List<Zahlung> zahlungen = rn.getZahlungen();
					for (Zahlung z : zahlungen) {
						TimeTool tt = new TimeTool(z.getDatum());
						if (tt.isAfter(now)) {
							continue;
						}
						betrag.subtractMoney(z.getBetrag());
					}
					row[3] = betrag.getAmountAsString();
					row[2] = RnStatus.getStatusText(status);
					result.add(row);
				}
				
			}
		}
		monitor.worked(step);
	}
	this.dataSet.setContent(result);
	
	monitor.done();
	return Status.OK_STATUS;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:63,代码来源:OffenePostenListe.java

示例10: getParentId

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
private String getParentId(String parentCode) throws SQLException{
	Stm source = null;
	List<TimeTool> parentValidFroms = new ArrayList<>();
	try {
		source = cacheDb.getStatement();
		try (ResultSet res = source
			.query(String.format("SELECT * FROM %sKAPITEL_TEXT WHERE SPRACHE=%s AND KNR=%s", //$NON-NLS-1$
				TarmedReferenceDataImporter.ImportPrefix, lang, JdbcLink.wrap(parentCode)))) {
			while (res != null && res.next()) {
				String code = res.getString("KNR"); //$NON-NLS-1$
				if (code.trim().equals("I")) { //$NON-NLS-1$
					continue;
				}
				parentValidFroms.add(new TimeTool(res.getString("GUELTIG_VON")));
			}
		}
	} finally {
		if (source != null) {
			cacheDb.releaseStatement(source);
		}
	}
	if (parentValidFroms.isEmpty()) {
		throw new IllegalStateException("No parent valid from found for " + parentCode);
	}
	// determine the latest matching parent valid from
	TimeTool latestParentValidFrom = null;
	for (TimeTool parentValidFrom : parentValidFroms) {
		if (latestParentValidFrom == null && parentValidFrom.isBeforeOrEqual(validFrom)) {
			latestParentValidFrom = parentValidFrom;
			continue;
		}
		if (parentValidFrom.isBeforeOrEqual(validTo)
			&& parentValidFrom.isAfter(latestParentValidFrom)) {
			latestParentValidFrom = parentValidFrom;
		}
	}
	if (latestParentValidFrom == null) {
		throw new IllegalStateException("No parent valid from found for " + parentCode + " in "
			+ parentValidFroms.size() + " values");
	}
	
	return parentCode + "-" + latestParentValidFrom.toString(TimeTool.DATE_COMPACT) //$NON-NLS-1$
		+ getLawIdExtension();
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:45,代码来源:ChapterImporter.java

示例11: isValid

import ch.rgw.tools.TimeTool; //导入方法依赖的package包/类
public boolean isValid(TimeTool now){
	if (now.isAfter(getValidFrom()) && now.isBeforeOrEqual(getValidTo())) {
		return true;
	}
	return false;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:7,代码来源:ComplementaryLeistung.java


注:本文中的ch.rgw.tools.TimeTool.isAfter方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。