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


Java TimeTool类代码示例

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


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

示例1: getColumnText

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
@Override
public String getColumnText(Object element, int columnIndex){
	IFinding item = (IFinding) element;
	
	switch (columnIndex) {
	case 0: {
		if (item instanceof IObservation) {
			IObservation ob = (IObservation) item;
			return ob.getEffectiveTime().isPresent()
					? new TimeTool(ob.getEffectiveTime().get()).toString(TimeTool.FULL_GER)
					: "";
		}
		break;
		
	}
	case 1: {
		return item.getText().isPresent() ? item.getText().get() : "";
	}
	default:
		break;
	}
	return "";
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:24,代码来源:FindingsView.java

示例2: getObject

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
/**
 * Returns the Object denoted by the given description
 * 
 * @param descriptor
 *            Description of the data
 * @param dependentObject
 *            not used
 * @param dates
 *            not used
 * @param params
 *            not used
 */
public Result<Object> getObject(String descriptor, PersistentObject dependentObject,
	String dates, String[] params){
	Result<Object> ret = null;
	Termin termin = (Termin) ElexisEventDispatcher.getSelected(Termin.class);
	
	if (termin != null && descriptor.equals(Termin.FLD_BEREICH)) {
		ret = new Result<Object>(termin.getBereich());
	} else if (termin != null && descriptor.equals(Termin.FLD_TAG)) {
		time.set(termin.getDay());
		ret = new Result<Object>(time.toString(TimeTool.DATE_GER));
	} else {
		ret =
			new Result<Object>(Result.SEVERITY.ERROR, IDataAccess.INVALID_PARAMETERS,
				"Ungültiger Parameter", //$NON-NLS-1$
				dependentObject, true);
	}
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:31,代码来源:DataAccessor.java

示例3: getHierarchy

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
/**
 * Get the list of codes of the possible slave services allowed by tarmed.
 * 
 * @return
 */
public List<String> getHierarchy(TimeTool date){
	List<String> ret = new ArrayList<>();
	List<String> hierarchy = getExtStringListField(TarmedLeistung.EXT_FLD_HIERARCHY_SLAVES);
	if (!hierarchy.isEmpty()) {
		for (String string : hierarchy) {
			int dateStart = string.indexOf('[');
			String datesString = string.substring(dateStart + 1, string.length() - 1);
			String codeString = string.substring(0, dateStart);
			if (isDateWithinDatesString(date, datesString)) {
				ret.add(codeString);
			}
		}
	}
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:21,代码来源:TarmedLeistung.java

示例4: createFormulaEnv

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
private void createFormulaEnv(){
	// create a second lab item to select
	LabItem item =
		new LabItem("kuerzel1", "testname1", org, "0-1", "0-2", "mg/dl", LabItemTyp.NUMERIC,
			"G gruppe", "1");
	// create a lab item made up by a formula
	formulaItem =
		new LabItem("formula", "formulatest", org, "0-2", "0-4", "mg/dl", LabItemTyp.FORMULA,
			"G gruppe", "2");
	
	formulaPat = new Patient("testName", "testVorname", "01.01.79", "m");
	
	formulaResult = new LabResult(formulaPat, new TimeTool("01.01.00"), item, "0.5", "comment");
	
	formulaItem.setFormula("G_1*2");
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:Test_LabItem.java

示例5: testFindAllUserIsResponsibleFor

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
@Test
public void testFindAllUserIsResponsibleFor(){
	reminderA = new Reminder(null, new TimeTool().toString(TimeTool.DATE_GER),
		Visibility.ALWAYS, "", "TestMessage");
	reminderA.setResponsible(Collections.singletonList(CoreHub.actUser));
	reminderA.set(Reminder.FLD_STATUS, Integer.toString(ProcessStatus.CLOSED.numericValue()));
	
	reminderB = new Reminder(null, new TimeTool().toString(TimeTool.DATE_GER),
		Visibility.ALWAYS, "", "TestMessage");
	reminderB.setResponsible(Collections.singletonList(CoreHub.actUser));
	
	reminderC = new Reminder(null, null, Visibility.ALWAYS, "", "TestMessage");
	reminderC.setResponsible(null);
	
	assertEquals(3, Reminder.findAllUserIsResponsibleFor(CoreHub.actUser, false).size());
	assertEquals(2, Reminder.findAllUserIsResponsibleFor(CoreHub.actUser, true).size());
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:18,代码来源:Test_Reminder.java

示例6: testFindRemindersDueFor

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
@Test
public void testFindRemindersDueFor(){
	reminderA = new Reminder(null, new TimeTool().toString(TimeTool.DATE_GER),
		Visibility.ALWAYS, "", "TestMessage");
	reminderA.setResponsible(Collections.singletonList(CoreHub.actUser));
	reminderA.set(Reminder.FLD_DUE, new TimeTool().toString(TimeTool.DATE_GER));
	
	reminderB = new Reminder(null, new TimeTool().toString(TimeTool.DATE_GER),
		Visibility.ALWAYS, "", "TestMessage");
	reminderB.setResponsible(Collections.singletonList(CoreHub.actUser));
	TimeTool timeTool = new TimeTool();
	timeTool.addDays(-2);
	reminderB.set(Reminder.FLD_DUE, timeTool.toString(TimeTool.DATE_GER));
	
	reminderC = new Reminder(null, null, Visibility.ALWAYS, "", "TestMessage");
	reminderC.setResponsible(null);
	
	List<Reminder> findRemindersDueFor =
		Reminder.findRemindersDueFor(null, CoreHub.actUser, false);
	assertEquals(2, findRemindersDueFor.size());
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:22,代码来源:Test_Reminder.java

示例7: DayDateCombo

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
/**
 * @param parent
 * @param text1
 *            the text to display in front of the spinner
 * @param text2
 *            the text to display between spinner and DatePicker
 * @param text1Neg
 *            the text to display in front of the spinner if date is before today
 * @param text2Neg
 *            the text to display between spinner and DatePicker if date is before today
 * @since 3.1
 */
public DayDateCombo(Composite parent, String text1, String text2, String text1Neg,
	String text2Neg){
	super(parent, SWT.NONE);
	
	this.text1 = text1;
	this.text2 = text2;
	this.text1Neg = text1Neg;
	this.text2Neg = text2Neg;
	
	ttNow = new TimeTool();
	ttNow.chop(3);
	setLayout(new RowLayout(SWT.HORIZONTAL));
	frontLabel = UiDesk.getToolkit().createLabel(this, text1);
	spl = new SpinnerListener();
	dl = new DateListener();
	spinner = new Spinner(this, SWT.NONE);
	middleLabel = UiDesk.getToolkit().createLabel(this, text2);
	dp = new DatePickerCombo(this, SWT.NONE);
	setListeners();
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:33,代码来源:DayDateCombo.java

示例8: importLine

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
private void importLine(final String[] line){
	if (line.length == 9) {
		if (line[6].equals("")) {
			line[6] = TimeTool.BEGINNING_OF_UNIX_EPOCH;
		}
		if (line[7].equals("")) {
			line[7] = TimeTool.END_OF_UNIX_EPOCH;
		}
		Query<Leistung> qbe = new Query<Leistung>(Leistung.class);
		qbe.add("Kuerzel", "=", line[1]);
		List<Leistung> res = qbe.execute();
		Leistung lst;
		if (res.size() > 0) {
			lst = res.get(0);
			lst.set(new String[] {
				"parent", "Name", "Kosten", "Preis", "Zeit", "DatumVon", "DatumBis"
			}, line[0], line[2], line[3], line[4], line[5], line[6], line[7]);
		} else {
			new Leistung(null, line[0], line[2], line[1], line[3], line[4], line[5], line[6],
				line[7]);
		}
	}
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:24,代码来源:Importer.java

示例9: updateLock

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
/**
 * Refresh the lock i.e. extend its validity time by the original timeout once again. An
 * application should prefer this update mechanism over a too long timeout, because in case of
 * abnormal termination, the lock does not stay too long active.
 * 
 * @param n
 *            number of the lockfile (as received by the lock() call)
 * @return true on success
 */
public boolean updateLock(int n){
	File file = new File(baseDir, constructFilename(n));
	if (!file.exists()) {
		return false;
	}
	try {
		DataOutputStream daos = new DataOutputStream(new FileOutputStream(file));
		daos.writeUTF(new TimeTool().toString(TimeTool.FULL_ISO));
		daos.close();
		return true;
	} catch (Exception ex) {
		ExHandler.handle(ex);
		return false;
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:25,代码来源:LockFile.java

示例10: testGetPatient

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
@Test
public void testGetPatient() throws ElexisException, IOException{
	File[] files = loadv24Files();
	assertNotSame(0, files.length);
	
	for (int i = 0; i < files.length; i++) {
		File file = files[i];
		List<HL7Reader> hl7Readers = HL7ReaderFactory.INSTANCE.getReader(file);
		assertNotNull(hl7Readers);
		assertEquals(1, hl7Readers.size());
		HL7Reader reader = hl7Readers.get(0);
		reader.readObservation(resolver, false);
		
		IPatient patient = reader.getPatient();
		assertEquals("Grissemann", patient.getFamilyName());
		assertTrue(patient.getDateOfBirth().isEqual(new TimeTool("17.05.1966")));
		assertEquals(Gender.MALE, patient.getGender());
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:20,代码来源:Test_HL7_v24_Imports.java

示例11: setTermin

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
@Override
public void setTermin(Termin tf){
	Termin t = tf;
	StringBuilder sb = new StringBuilder(200);
	TimeSpan ts = t.getTimeSpan();
	sb.append(ts.from.toString(TimeTool.TIME_SMALL))
		.append("-").append(ts.until.toString(TimeTool.TIME_SMALL)) //$NON-NLS-1$
		.append(" ");
	if (t.isRecurringDate()) {
		sb.append(new SerienTermin(t).getRootTermin().getPersonalia());
	} else {
		sb.append(t.getPersonalia());
	}
	sb.append("\n(") //$NON-NLS-1$ //$NON-NLS-2$
		.append(t.getType())
		.append(",").append(t.getStatus()).append(")\n--------\n").append(t.getGrund()); //$NON-NLS-1$ //$NON-NLS-2$
	sb.append("\n--------\n").append(t.getStatusHistoryDesc());
	tDetail.setText(sb.toString());
	sb.setLength(0);
	sb.append(StringTool.unNull(t.get(Termin.FLD_CREATOR))).append("/").append( //$NON-NLS-2$
		t.getCreateTime().toString(TimeTool.FULL_GER));
	lCreator.setText(sb.toString());
	agenda.dispatchTermin(t);
	
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:26,代码来源:TagesView.java

示例12: getLatest

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
@SuppressWarnings("unchecked")
private TimeTool getLatest(final Tree t){
	if (t.contents instanceof Rechnung) {
		return new TimeTool(((Rechnung) t.contents).getDatumRn());
	} else if (t.contents instanceof Fall) {
		return getLatestFromCase(t);
	} else if (t.contents instanceof Patient) {
		Tree runner = t.getFirstChild();
		TimeTool latest = new TimeTool();
		while (runner != null) {
			TimeTool lff = getLatestFromCase(runner);
			if (lff.isBefore(latest)) {
				latest.set(lff);
			}
			runner = runner.getNextSibling();
		}
		return latest;
	}
	return null;
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:21,代码来源:RnContentProvider.java

示例13: LabOrder

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
/**
 * @since 3.2
 */
public LabOrder(String userId, String mandatorId, String patientId, ILabItem item, String labResultId,
	String orderId, String groupname, TimeTool time){
	create(null);
	set(FLD_USER, userId);
	set(FLD_MANDANT, mandatorId);
	set(FLD_PATIENT, patientId);
	set(FLD_ITEM, item.getId());
	set(FLD_TIME, time.toString(TimeTool.TIMESTAMP));
	set(FLD_OBSERVATIONTIME, time.toString(TimeTool.TIMESTAMP));
	set(FLD_ORDERID, orderId);
	set(FLD_GROUPNAME, groupname);
	setState(State.ORDERED);
	if (labResultId != null) {
		set(FLD_RESULT, labResultId);
	}
	if (item.getTyp() == LabItemTyp.FORMULA) {
		createResult();
		setState(State.DONE);
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:24,代码来源:LabOrder.java

示例14: createDialogArea

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
@Override
protected Control createDialogArea(Composite parent){
	Composite ret = (Composite) super.createDialogArea(parent);
	ret.setLayout(new GridLayout());
	
	String resources =
		CoreHub.localCfg.get(PreferenceConstants.AG_DAYSTOSHOW,
			StringTool.join(TimeTool.Wochentage, ",")); //$NON-NLS-1$
	String[] daysSelected = resources.split(",");
	
	for (TimeTool.DAYS day : TimeTool.DAYS.values()) {
		Button b = new Button(ret, SWT.CHECK);
		b.setText(day.fullName);
		b.setSelection(false);
		b.setData(day.numericDayValue);
		for (String string : daysSelected) {
			if (string.toLowerCase().equalsIgnoreCase(day.fullName.toLowerCase()))
				b.setSelection(true);
		}
		
	}
	return ret;
}
 
开发者ID:elexis,项目名称:elexis-3-base,代码行数:24,代码来源:ColumnHeader.java

示例15: createReminder

import ch.rgw.tools.TimeTool; //导入依赖的package包/类
private void createReminder(Anwender user, List<LabOrder> orders){
	StringBuilder message = new StringBuilder("Labor"); //$NON-NLS-1$
	StringBuilder params = new StringBuilder();
	if (orders != null && !orders.isEmpty()) {
		message.append(" ")
			.append(
				ch.elexis.core.ui.laboratory.controls.Messages.LaborOrdersComposite_columnOrdernumber)
			.append(": ").append(orders.get(0).get(LabOrder.FLD_ORDERID)); //$NON-NLS-1$
		params.append(LabOrder.FLD_ORDERID + "=" + orders.get(0).get(LabOrder.FLD_ORDERID));
	}
	Reminder reminder = new Reminder(patient, date.toString(TimeTool.DATE_ISO),
		Visibility.ALWAYS, params.toString(), message.toString()); //$NON-NLS-1$
	if (user != null) {
		reminder.set("Responsible", user.getId()); //$NON-NLS-1$
	}
}
 
开发者ID:elexis,项目名称:elexis-3-core,代码行数:17,代码来源:LaborVerordnungDialog.java


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