Java Code Examples for ims.framework.utils.Date.toString()

The following are Jave code examples for showing how to use toString() of the ims.framework.utils.Date class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
Example 1
Project: AvoinApotti   File: DTOHelper.java   Source Code and License Vote up 5 votes
public static String convertToDtoDate(java.util.Date javaDate) 
{
	if(javaDate == null)
		throw new CodingRuntimeException("javaDate cannot be null in method convertToDtoDate");

	Date imsDate = new Date(javaDate); 
	return imsDate.toString(DateFormat.ISO);
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License Vote up 5 votes
private String getSlotDateTimeString(SessionSlotListVo slot) {
	String slotDateTime = "";

	Date daySel = form.bookingCalendarAppts().getSelectedDay();
	if (daySel != null)
		slotDateTime += daySel.toString();

	if (slot.getStartTmIsNotNull())
		slotDateTime += " " + slot.getStartTm();

	return slotDateTime;
}
 
Example 3
Project: AvoinApotti   File: ADTAdmissionDetailsComponentImpl.java   Source Code and License Vote up 4 votes
public EpisodeofCareShortVoCollection listEpisodesOfCare(PatientRefVo patientRef, Date admissionDate)
{
	if(patientRef == null || patientRef.getID_Patient()==null)
		throw new CodingRuntimeException("Cannot get Patient value on null patientRef.");
	
	
	StringBuffer hql = new StringBuffer("select epCare from EpisodeOfCare as epCare left join epCare.careSpell as careSpell left join careSpell.patient as patient ");
	hql.append(" where (patient.id=:patID and  epCare.startDate <= :admDate )order by epCare.startDate desc ");
	
	DomainFactory factory = getDomainFactory();
	java.util.Date tempDate=new java.util.Date(admissionDate.toString());
	
	List<?> list = factory.find(hql.toString(), new String[] {"patID","admDate"}, new Object[] {patientRef.getID_Patient(),tempDate});
	
	return EpisodeofCareShortVoAssembler.createEpisodeofCareShortVoCollectionFromEpisodeOfCare(list);
}
 
Example 4
Project: AvoinApotti   File: V231NasMapper.java   Source Code and License Vote up 4 votes
public final ImsNasMsg startGenSchedMsg(MSH msh, SCH sch) throws Exception
{
	ImsNasMsg nm = new ImsNasMsg();
	String appt_id = "";
	String pkey = "";
	boolean bUpdating = false;
	Date date = new Date();
	Time time = new Time();
	
	
	nm.addPair("*SERVICE", "GENERIC_SCHEDULE");
	String fillerAppId = sch.getFillerAppointmentID().getEntityIdentifier().getValue();
	 
	if ((appt_id = getSchedAppointment(fillerAppId)) == null)
		nm.addPair("ACTION", "INSERT");
	else
	{
		nm.addPair("ACTION", "UPDATE");
		nm.addPair("APPT_ID", appt_id);
		bUpdating = true;
	}
	
	//fillerAppId = sch.getFillerAppointmentID().getEntityIdentifier().getValue();
	StringTokenizer tokens = new StringTokenizer(fillerAppId,"/");
	tokens.nextToken();
	pkey = tokens.nextToken();
	nm.addPair("F_APPT_ID",fillerAppId);		
	nm.addPair("F_APPL",msh.getSendingApplication().getNamespaceID().getValue());
	nm.addPair("PKEY",pkey);			
	
	String reason = sch.getEventReason().getIdentifier().getValue();
	nm.addPair("EV_REAS",reason);
	//WDEV-8755
	if (reason != null && reason.toUpperCase().equals("REARRANGE"))
		nm.addPair("F_STATUS","Booked");
	else
		nm.addPair("F_STATUS",sch.getFillerStatusCode().getIdentifier().getValue());
	
	nm.addPair("APP_REAS",sch.getAppointmentReason().getIdentifier().getValue());
	
	String strTmpDateTime = null;
	strTmpDateTime = sch.getAppointmentTimingQuantity(0).getStartDateTime().getTimeOfAnEvent().getValue();
	if (strTmpDateTime == null || strTmpDateTime.equals(""))
		throw new HL7Exception("SCH.11 - Scheduled Date/Time is a required field");

	nm.addPair("ST_TIME",strTmpDateTime.substring(0,8));

	//MAXGEN-807, WDEV-8755 - put the extra 00 on time in JavaServer Business Rule as it's used to
	//reconstruct the filler_app_id, 
	//Removing it here allows us to disable the TrimFillerAppTstp trigger on sched_appointment	
	nm.addPair("APP_ST_TIME",strTmpDateTime.substring(8,12));
	nm.addPair("APP_END_TIME",strTmpDateTime.substring(8,12));

	nm.addPair("F_PER",sch.getEnteredByPerson(0).getIDNumber().getValue());
	nm.addPair("F_PHONE",sch.getFillerContactPhoneNumber().getPhoneNumber().getValue());
	nm.addPair("E_PER",sch.getEnteredByPerson(0).getIDNumber().getValue());
	nm.addPair("E_PHONE",sch.getFillerContactPhoneNumber().getPhoneNumber().getValue());
	
	date.toString(DateFormat.ISO);
	
	//df.parse(date.toString());
	nm.addPair("CDAT",date.toString(DateFormat.ISO));
	nm.addPair("CTIM",time.toString(TimeFormat.FLAT6));
	nm.addPair("RDAT",date.toString(DateFormat.ISO));
	nm.addPair("RTIM",time.toString(TimeFormat.FLAT6));
	if (bUpdating)
	{
		nm.addPair("UDAT",date.toString(DateFormat.ISO));
		nm.addPair("UTIM",time.toString(TimeFormat.FLAT6));
	}
	return nm;
}