Java Code Examples for ims.framework.utils.TimeFormat

The following are top voted examples for showing how to use ims.framework.utils.TimeFormat. These examples are extracted from open source projects. You can vote up the examples you like and your votes will be used in our system to generate more good examples.
Example 1
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void displayCreationInfo()
{
	ClinicalNotesVo voClinicalNotes = form.getLocalContext().getClinicalNotes();
	StringBuffer notes = new StringBuffer();
	if (voClinicalNotes != null && voClinicalNotes.getID_ClinicalNotesIsNotNull())
	{
		notes.append("Creation:          ");
		notes.append("Recording User:    ");
		notes.append(voClinicalNotes.getSystemInfoIsNotNull() ? voClinicalNotes.getSystemInfo().getCreationUser() : "");
		notes.append(";    ");
		DateTime recDateTime =  voClinicalNotes.getSystemInfo().getCreationDateTime();
		if(recDateTime != null)
		{
			notes.append("Recording Date:   ");
			notes.append(recDateTime.getDate().toString(DateFormat.STANDARD));
			notes.append(";    ");
			notes.append("Recording Time:   ");
			notes.append(recDateTime.getTime().toString(TimeFormat.DEFAULT));
			notes.append(";    ");
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateInstance(CareContextShortVo voCareContext)
{		
	clearScreen();
	if (voCareContext != null)
	{	
		SkinAssessmentCollection skinAssVOCollection = domain.listSkinAssessment(voCareContext);
		if (skinAssVOCollection != null)
		{
			skinAssVOCollection = skinAssVOCollection.sort(SortOrder.DESCENDING);
			
			form.bNew().setEnabled(false);
			form.btnNext().setEnabled(false);
			form.btnPrevious().setEnabled(false);
			clearCombos();
			
			//String dateTime = "";
			form.comboBoxAssessment().clear();
			for(int i=0; i<skinAssVOCollection.size(); i++)
			{
				if(skinAssVOCollection.get(i).getDateTimeInitiated() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getDate() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getTime() != null)
					form.comboBoxAssessment().newRow(skinAssVOCollection.get(i), skinAssVOCollection.get(i).getDateTimeInitiated().getDate().toString(DateFormat.STANDARD) + " / " + skinAssVOCollection.get(i).getDateTimeInitiated().getTime().toString(TimeFormat.DEFAULT));			
			}
			
			if(form.comboBoxAssessment().getValues() != null && form.comboBoxAssessment().getValues().size() > 0)
			{
				if(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment() != null)
					form.comboBoxAssessment().setValue(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment());
				else
					form.comboBoxAssessment().setValue((SkinAssessment)form.comboBoxAssessment().getValues().get(0));
				refreshAssessment();
			}
		}
	}
	else
		form.getLocalContext().setSkinAssessment(null);
}
 
Example 3
Project: AvoinApotti   File: DTOHelper.java   Source Code and License 5 votes vote down vote up
public static String convertToDtoTime(java.util.Date javaDate) 
{
	if(javaDate == null)
		throw new CodingRuntimeException("javaDate cannot be null in method convertToDtoTime");
	
	DateTime imsDate = new DateTime(javaDate); 
	return imsDate.getTime().toString(TimeFormat.FLAT4);
}
 
Example 4
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private void copyHomeleaveToDto(Homeleave homeLeaveRec, HomeLeaveVo voHomeLeave, InPatientEpisodeADTVo inpatientEpisode)
{
	HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
 	
	hlRec.Pkey = getPatientIdValue(inpatientEpisode, PatIdType.PKEY);
	hlRec.Hospnum = getPatientIdValue(inpatientEpisode, PatIdType.HOSPNUM);

	InpatientEpisode doInpat = InPatientEpisodeADTVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatientEpisode);
	hlRec.Rescode = doInpat.getPasEvent() != null && doInpat.getPasEvent().getLocation() != null ? doInpat.getPasEvent().getLocation().getExtCode(TaxonomyType.PAS.getID()) : null;
	hlRec.Mors = DTOHelper.getPasMapping(doInpat.getWardType());

	hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
	hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

	hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
	hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";
	if(hlRec.Mors.equals("M"))
	{
		if(doInpat.getPasEvent().getPatient().getSex() != null)
		{
			if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	
	}
	else if(hlRec.Mors.equals("S"))
		hlRec.Btyp = "S";


	hlRec.Hlfl = "Y"; //"Y" on an insert
	
	hlRec.Webadt = "Y";				
}
 
Example 5
Project: AvoinApotti   File: ApplicationUsersImpl.java   Source Code and License 5 votes vote down vote up
private void copyUserToDto(App_users userRec, AppUser user)
{
	App_usersRecord rec = userRec.DataCollection.get(0);
	
	if (user.getId() != null)
		rec.User_id = user.getId() + "";
	rec.Uname = user.getUsername();		
	rec.Upass = user.getPassword();
	rec.Dbname = "imsuser";
	rec.Dbpass = "welcome";
	if (user.getSystemInformation().getCreationDateTime() != null)			
	{
		rec.Rdat = new Date(user.getSystemInformation().getCreationDateTime()).toString(DateFormat.ISO);
		rec.Rtim = new DateTime(user.getSystemInformation().getCreationDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Rusr = getUserId(user.getSystemInformation().getCreationUser());

	if (user.getSystemInformation().getLastUpdateDateTime() != null)
	{
		rec.Udat = new Date(user.getSystemInformation().getLastUpdateDateTime()).toString(DateFormat.ISO);
		rec.Utim = new DateTime(user.getSystemInformation().getLastUpdateDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Uusr = getUserId(user.getSystemInformation().getLastUpdateUser());
	rec.Comment = "Replicated from Maxims Web Application";
	
	if (user.getEffectiveFrom() != null)
		rec.Effr = new Date(user.getEffectiveFrom()).toString(DateFormat.ISO);	
	else
		rec.Effr = new Date().toString(DateFormat.ISO);
	if (user.getEffectiveTo() != null)
		rec.Efft = new Date(user.getEffectiveTo()).toString(DateFormat.ISO);			
	if (user.getPwdExpDate() != null)
		rec.Passwd_exp = new Date(user.getPwdExpDate()).toString(DateFormat.ISO);			
	if (user.isIsActive() != null && user.isIsActive().booleanValue() == false)
		rec.Active = "I";
	else
		rec.Active = "A";		
}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateInstance(CareContextShortVo voCareContext)
{		
	clearScreen();
	if (voCareContext != null)
	{	
		SkinAssessmentCollection skinAssVOCollection = domain.listSkinAssessment(voCareContext);
		if (skinAssVOCollection != null)
		{
			skinAssVOCollection = skinAssVOCollection.sort(SortOrder.DESCENDING);
			
			form.bNew().setEnabled(false);
			form.btnNext().setEnabled(false);
			form.btnPrevious().setEnabled(false);
			clearCombos();
			
			//String dateTime = "";
			form.comboBoxAssessment().clear();
			for(int i=0; i<skinAssVOCollection.size(); i++)
			{
				if(skinAssVOCollection.get(i).getDateTimeInitiated() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getDate() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getTime() != null)
					form.comboBoxAssessment().newRow(skinAssVOCollection.get(i), skinAssVOCollection.get(i).getDateTimeInitiated().getDate().toString(DateFormat.STANDARD) + " / " + skinAssVOCollection.get(i).getDateTimeInitiated().getTime().toString(TimeFormat.DEFAULT));			
			}
			
			if(form.comboBoxAssessment().getValues() != null && form.comboBoxAssessment().getValues().size() > 0)
			{
				if(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment() != null)
					form.comboBoxAssessment().setValue(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment());
				else
					form.comboBoxAssessment().setValue((SkinAssessment)form.comboBoxAssessment().getValues().get(0));
				refreshAssessment();
			}
		}
	}
	else
		form.getLocalContext().setSkinAssessment(null);
}
 
Example 7
Project: openMAXIMS   File: DTOHelper.java   Source Code and License 5 votes vote down vote up
public static String convertToDtoTime(java.util.Date javaDate) 
{
	if(javaDate == null)
		throw new CodingRuntimeException("javaDate cannot be null in method convertToDtoTime");
	
	DateTime imsDate = new DateTime(javaDate); 
	return imsDate.getTime().toString(TimeFormat.FLAT4);
}
 
Example 8
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private void copyHomeleaveToDto(Homeleave homeLeaveRec, HomeLeaveVo voHomeLeave, InPatientEpisodeADTVo inpatientEpisode)
{
	HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
 	
	hlRec.Pkey = getPatientIdValue(inpatientEpisode, PatIdType.PKEY);
	hlRec.Hospnum = getPatientIdValue(inpatientEpisode, PatIdType.HOSPNUM);

	InpatientEpisode doInpat = InPatientEpisodeADTVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatientEpisode);
	hlRec.Rescode = doInpat.getPasEvent() != null && doInpat.getPasEvent().getLocation() != null ? doInpat.getPasEvent().getLocation().getExtCode(TaxonomyType.PAS.getID()) : null;
	hlRec.Mors = DTOHelper.getPasMapping(doInpat.getWardType());

	hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
	hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

	hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
	hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";
	if(hlRec.Mors.equals("M"))
	{
		if(doInpat.getPasEvent().getPatient().getSex() != null)
		{
			if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	
	}
	else if(hlRec.Mors.equals("S"))
		hlRec.Btyp = "S";


	hlRec.Hlfl = "Y"; //"Y" on an insert
	
	hlRec.Webadt = "Y";				
}
 
Example 9
Project: openMAXIMS   File: CaseNoteTrackingImpl.java   Source Code and License 5 votes vote down vote up
public ims.core.vo.CaseNoteFolderVo saveCaseNote(ims.core.vo.CaseNoteFolderVo voCaseNote) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	Casenote cnRec = null;
	try
	{
		cnRec = (Casenote) getDTOInstance(Casenote.class);
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	cnRec.DataCollection.add();
	CasenoteRecord dtoCN = cnRec.DataCollection.get(0);

	dtoCN.Vol = voCaseNote.getVolume();
	dtoCN.Curr_loc = voCaseNote.getLocation();
	dtoCN.Move_to = voCaseNote.getMoveTo();
	dtoCN.Loc_date = voCaseNote.getLocDate().toString(DateFormat.ISO);
	dtoCN.Loc_time = voCaseNote.getLocTime().toString(TimeFormat.FLAT6);
	dtoCN.Comm = voCaseNote.getComments();
	dtoCN.Unam = voCaseNote.getUNAM();
	dtoCN.Rdat = voCaseNote.getRDAT().toString(DateFormat.ISO);
	dtoCN.Rtim = voCaseNote.getRTIM().toString(TimeFormat.FLAT6);
	dtoCN.Hospnum = voCaseNote.getHOSPNUM();
	
	Result result = cnRec.update();
	if(result != null && result.getId() < 0)
		throw new DomainInterfaceException("Attempt to save to CaseNote failed " + result.getMessage());
	
	return null;
}
 
Example 10
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getAppointmentTime(Sd_appt_dtsRecord record)
{
	if(record != null)
	{
		Time startTime = getTimeFromString(record.Stm);
		Time endTime   = getTimeFromString(record.Etm);
		return startTime.toString(TimeFormat.DEFAULT) + " - " + endTime.toString(TimeFormat.DEFAULT);
	}
	return null;
}
 
Example 11
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time getTimeFromString(String time)
{
	Time tm = null;
	if(time != null && !time.equals(""))
	try{ tm = new Time(time, TimeFormat.FLAT6);}catch(RuntimeException e){}
	return tm;
}
 
Example 12
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time getTimeFromString(String time)
{
	Time tm = null;
	
	try{
	tm = new Time(time, TimeFormat.FLAT6);}
	catch(RuntimeException e){showMessage(e.getMessage());}
	
	return tm;
}
 
Example 13
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time getTimeFromString(String time)
{
	try
	{
		return new Time(time, TimeFormat.FLAT6);
	}
	catch (Exception e)
	{
		return null;
	}
}
 
Example 14
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time getTimeFromString(String value)
{
	Time time = null;
	try
	{	time = new Time(value, TimeFormat.FLAT6);
	} catch (RuntimeException e)
	{
		time = null;
	}
	return time;
}
 
Example 15
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getTimeFromString(String time)
{
	Time tm = null;
	if(time != null && !time.equals(""))
	try{ tm = new Time(time, TimeFormat.FLAT6);}catch(RuntimeException e){}
	return tm != null?tm.toString(TimeFormat.DEFAULT):"";
}
 
Example 16
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void onFormOpen() throws FormOpenException 
{
	form.ViewSession().setEnabled(false);
	form.MoveTo().setEnabled(false);
	form.ResourceFrom().setValue(form.getGlobalContext().CcoSched.Reschedule.getSelectedResourceName());
	form.getGlobalContext().CcoSched.Reschedule.getListOfAppoinments();//Context.ContextReschedule.ListOfAppointments;
	//foreach (dto.Sd_appt_dtsDTO.Sd_appt_dtsClient appointment in ar)
	for(int i=0; i<form.getGlobalContext().CcoSched.Reschedule.getListOfAppoinments().count(); i++)
	{
		Sd_appt_dts.Sd_appt_dtsRecord appointment = form.getGlobalContext().CcoSched.Reschedule.getListOfAppoinments().get(i);
		GenForm.MainGridRow row = form.MainGrid().getRows().newRow();
		row.setValue(appointment);

		Time Dtodt = getTimeFromString(appointment.Stm);
		row.setTime(Dtodt != null?Dtodt.toString(TimeFormat.DEFAULT):"");// (dt.IsNull ? "" : string.Format("{0:D2}.{1:D2}", dt.Value.Hour, dt.Value.Minute));

		row.setHospitalNumber(appointment.Hospnum);

		row.setName(appointment.Titl + " " + getPatientName(appointment));

		row.setCategory(appointment.Txcattypetxt);
		row.setAttendingAs(appointment.Attnd_astxt);
		row.setModality(appointment.Modidtxt);
		row.setEnergy(appointment.Modenrgy);
		row.setUnit(appointment.Modenrgyunittxt);
		//ICCO939 - Images are not pulled through
		if (appointment.First_appt_id.equals(appointment.Appt_id))
			row.setBooking(form.getImages().CcoSched.First);
		else if (appointment.Last_appt_id.equals(appointment.Appt_id))
			row.setBooking(form.getImages().CcoSched.Last);
	}
	GetResourcesAndGraph();
}
 
Example 17
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time getTimeFromString(String time)
{
	Time tm = null;
	
	try{
	tm = new Time(time, TimeFormat.FLAT6);}
	catch(RuntimeException e){showMessage(e.getMessage());}
	
	return tm;
}
 
Example 18
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean GetMovedApptsDetails(Sd_appt.Sd_apptRecord apptRecord)
{
	for (int i = 0; i < form.MovedGrid().getRows().size(); ++i)
	{
		Sd_sess_appts.Sd_sess_apptsSeqno3Record seqNo3Record = form.MovedGrid().getRows().get(i).getValue();
		if(seqNo3Record.Appt_head_id.equals(apptRecord.Appt_head_id))
		{				
			Sd_appt.Sd_apptAppt_idRecord app;
			for(int j=0; j<apptRecord.Appt_idCollection.count(); j++)
			{
				app = apptRecord.Appt_idCollection.get(j);
				if (app.Appt_id.equals(seqNo3Record.Seqno3))
				{
					Time newTime = form.MovedGrid().getRows().get(i).getNewTime();
					app.App_stm = newTime.toString(TimeFormat.FLAT6);
					Time endtime = form.MovedGrid().getRows().get(i).getNewTime();
					endtime.addMinutes(form.getGlobalContext().CcoSched.Booking.getTimeRequired().intValue());
					app.App_etm = endtime.toString(TimeFormat.FLAT6);	
					int rounding = GetRoundAttendanceTime(getSessionID(seqNo3Record));
					app.Att_tm = GetRoundingTime(rounding, form.MovedGrid().getRows().get(i).getNewTime()).toString(TimeFormat.FLAT6);
					app.Appt_stat = "-2195"; // Moved

					break;
				}
			}
		}
	}
	return true;
}
 
Example 19
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private String getTime(String isoTime)
{
	Time tm = null;
	if(isoTime != null && !isoTime.equals(""))
	try{ tm = new Time(isoTime, TimeFormat.FLAT6);}catch(RuntimeException e){showMessage(e.getMessage());}
	if(tm != null)
		return tm.toString(TimeFormat.DEFAULT);
	
	return "";
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time GetTimeFromString(String time)
{
	Time tm = null;
	if(time != null && !time.equals(""))
	try{ tm = new Time(time, TimeFormat.FLAT6);}catch(RuntimeException e){ShowMessage(e.getMessage());}
	return tm;
}
 
Example 21
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void PopulateFurtherAppts()
{
	ArrayList ar = (ArrayList)form.getGlobalContext().CcoSched.Rebooking.getData().clone();
	String tmp = new String();

	form.grdFurtherAppt().getRows().clear();

	SortArrayByDate(ar);
	form.getGlobalContext().CcoSched.Rebooking.setData(ar);
	for(int i=0; i<ar.size(); i++)
	{
		Object[] o  = (Object[]) ar.get(i);
		tmp = "";
		if (!((String)o[4]).equals(""))
		{					
			// Add Values To the Row
			GenForm.grdFurtherApptRow row = form.grdFurtherAppt().getRows().newRow();
			tmp += ((Date)o[1]) != null?((Date)o[1]).toString(DateFormat.STANDARD):""; 
			tmp += " - ";
			String[] time = StringUtils.splitString(((String)o[2]), ":");
			Time dt = GetTimeFromString(time[0]+time[1]+"00");
			if (dt == null)
				ShowMessage("Wrong time format type");
			else
				tmp += dt.toString(TimeFormat.DEFAULT);
			row.setFurtherAppt(tmp);
			row.setValue((Date)o[1]);
		}
	}
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time GetTimeFromString(String time)
{
	Time tm = null;
	if(time != null && (time.equals("") == false))
	{
		try{ tm = new Time(time, TimeFormat.FLAT6);}catch(RuntimeException e){ShowError(e.getMessage());}
	}
	return tm;
}
 
Example 23
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time GetTimeFromString(String time)
{
	Time tm = null;
	if(time != null && !time.equals(""))
	try{ tm = new Time(time, TimeFormat.FLAT6);}catch(RuntimeException e){ShowMessage(e.getMessage());}
	return tm;
}
 
Example 24
Project: openMAXIMS   File: PatTreatmentPlanUpdateImpl.java   Source Code and License 5 votes vote down vote up
private String getServerTime(Calendar dateTime)
{
	if(dateTime != null)
	{
		Time tm = new Time(dateTime.getTime());
		return tm.toString(TimeFormat.FLAT6);
	}
		
	return "";
}
 
Example 25
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time roundTimeIfRequired(Time tmDummySlot)
{
	int round = 5;
	int intTime = Integer.parseInt(tmDummySlot.toString(TimeFormat.FLAT4));

	// check for remainder if there is a remainder rounding is required
	if (!(intTime % round == 0))
	{
		double result = Math.round((intTime + 5) / round) * round;
		String prepend = "";

		// WDEV-13221
		// Reversed conditions to correctly prepend
		if (intTime < 1)
			prepend = "0000";
		else if (intTime < 10)
			prepend = "000";
		else if (intTime < 100)
			prepend = "00";
		else if (intTime < 1000)
			prepend = "0";

		int res = (int) result;

		String timeVal = prepend + res;
		timeVal = correctSixtyMinHourIfNeeded(timeVal);

		timeVal = timeVal.substring(0, 2) + ":" + timeVal.substring(2, 4);

		tmDummySlot = new Time(String.valueOf(timeVal));
	}
	return tmDummySlot;
}
 
Example 26
Project: openMAXIMS   File: ApplicationUsersImpl.java   Source Code and License 5 votes vote down vote up
private void copyUserToDto(App_users userRec, AppUser user)
{
	App_usersRecord rec = userRec.DataCollection.get(0);
	
	if (user.getId() != null)
		rec.User_id = user.getId() + "";
	rec.Uname = user.getUsername();		
	rec.Upass = user.getPassword();
	rec.Dbname = "imsuser";
	rec.Dbpass = "welcome";
	if (user.getSystemInformation().getCreationDateTime() != null)			
	{
		rec.Rdat = new Date(user.getSystemInformation().getCreationDateTime()).toString(DateFormat.ISO);
		rec.Rtim = new DateTime(user.getSystemInformation().getCreationDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Rusr = getUserId(user.getSystemInformation().getCreationUser());

	if (user.getSystemInformation().getLastUpdateDateTime() != null)
	{
		rec.Udat = new Date(user.getSystemInformation().getLastUpdateDateTime()).toString(DateFormat.ISO);
		rec.Utim = new DateTime(user.getSystemInformation().getLastUpdateDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Uusr = getUserId(user.getSystemInformation().getLastUpdateUser());
	rec.Comment = "Replicated from Maxims Web Application";
	
	if (user.getEffectiveFrom() != null)
		rec.Effr = new Date(user.getEffectiveFrom()).toString(DateFormat.ISO);	
	else
		rec.Effr = new Date().toString(DateFormat.ISO);
	if (user.getEffectiveTo() != null)
		rec.Efft = new Date(user.getEffectiveTo()).toString(DateFormat.ISO);			
	if (user.getPwdExpDate() != null)
		rec.Passwd_exp = new Date(user.getPwdExpDate()).toString(DateFormat.ISO);			
	if (user.isIsActive() != null && user.isIsActive().booleanValue() == false)
		rec.Active = "I";
	else
		rec.Active = "A";		
}
 
Example 27
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private Time roundTimeIfRequired(Time tmDummySlot)
{
	int round = 5;
	int intTime = Integer.parseInt(tmDummySlot.toString(TimeFormat.FLAT4));

	// check for remainder if there is a remainder rounding is required
	if (!(intTime % round == 0))
	{
		double result = Math.round((intTime + 5) / round) * round;
		String prepend = "";

		// WDEV-13221
		// Reversed conditions to correctly prepend
		if (intTime < 1)
			prepend = "0000";
		else if (intTime < 10)
			prepend = "000";
		else if (intTime < 100)
			prepend = "00";
		else if (intTime < 1000)
			prepend = "0";

		int res = (int) result;

		String timeVal = prepend + res;
		timeVal = correctSixtyMinHourIfNeeded(timeVal);

		timeVal = timeVal.substring(0, 2) + ":" + timeVal.substring(2, 4);

		tmDummySlot = new Time(String.valueOf(timeVal));
	}
	return tmDummySlot;
}
 
Example 28
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * @param tmDummySlot
 * @return
 */
private Time roundTimeIfRequired(Time tmDummySlot)
{
	int round = 5;
	int intTime = Integer.parseInt(tmDummySlot.toString(TimeFormat.FLAT4));
	//check for remainder if there is a remainder rounding is required
	if(!(intTime%round == 0))
	{
		double result = Math.round((intTime+5) /round) * round;		
		String prepend = "";
		
		// WDEV-13221
		// Reversed conditions to correctly prepend
		if(intTime < 1)
			prepend = "0000";
		else if(intTime < 10)
			prepend = "000";
		else if(intTime < 100)
			prepend = "00";
		else if(intTime < 1000)
			prepend = "0";

		
		int res = (int) result;
		
		String timeVal = prepend + res;
		timeVal = correctSixtyMinHourIfNeeded(timeVal);
		
		timeVal = timeVal.substring(0,2) + ":" + timeVal.substring(2,4);
		
		tmDummySlot = new Time(String.valueOf(timeVal));
	}
	return tmDummySlot;
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateInstance(CareContextShortVo voCareContext)
{		
	clearScreen();
	if (voCareContext != null)
	{	
		SkinAssessmentCollection skinAssVOCollection = domain.listSkinAssessment(voCareContext);
		if (skinAssVOCollection != null)
		{
			skinAssVOCollection = skinAssVOCollection.sort(SortOrder.DESCENDING);
			
			form.bNew().setEnabled(false);
			form.btnNext().setEnabled(false);
			form.btnPrevious().setEnabled(false);
			clearCombos();
			
			//String dateTime = "";
			form.comboBoxAssessment().clear();
			for(int i=0; i<skinAssVOCollection.size(); i++)
			{
				if(skinAssVOCollection.get(i).getDateTimeInitiated() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getDate() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getTime() != null)
					form.comboBoxAssessment().newRow(skinAssVOCollection.get(i), skinAssVOCollection.get(i).getDateTimeInitiated().getDate().toString(DateFormat.STANDARD) + " / " + skinAssVOCollection.get(i).getDateTimeInitiated().getTime().toString(TimeFormat.DEFAULT));			
			}
			
			if(form.comboBoxAssessment().getValues() != null && form.comboBoxAssessment().getValues().size() > 0)
			{
				if(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment() != null)
					form.comboBoxAssessment().setValue(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment());
				else
					form.comboBoxAssessment().setValue((SkinAssessment)form.comboBoxAssessment().getValues().get(0));
				refreshAssessment();
			}
		}
	}
	else
		form.getLocalContext().setSkinAssessment(null);
}
 
Example 30
Project: openMAXIMS   File: DTOHelper.java   Source Code and License 5 votes vote down vote up
public static String convertToDtoTime(java.util.Date javaDate) 
{
	if(javaDate == null)
		throw new CodingRuntimeException("javaDate cannot be null in method convertToDtoTime");
	
	DateTime imsDate = new DateTime(javaDate); 
	return imsDate.getTime().toString(TimeFormat.FLAT4);
}
 
Example 31
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private void copyHomeleaveToDto(Homeleave homeLeaveRec, HomeLeaveVo voHomeLeave, InPatientEpisodeADTVo inpatientEpisode)
{
	HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
 	
	hlRec.Pkey = getPatientIdValue(inpatientEpisode, PatIdType.PKEY);
	hlRec.Hospnum = getPatientIdValue(inpatientEpisode, PatIdType.HOSPNUM);

	InpatientEpisode doInpat = InPatientEpisodeADTVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatientEpisode);
	hlRec.Rescode = doInpat.getPasEvent() != null && doInpat.getPasEvent().getLocation() != null ? doInpat.getPasEvent().getLocation().getExtCode(TaxonomyType.PAS.getID()) : null;
	hlRec.Mors = DTOHelper.getPasMapping(doInpat.getWardType());

	hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
	hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

	hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
	hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";
	if(hlRec.Mors.equals("M"))
	{
		if(doInpat.getPasEvent().getPatient().getSex() != null)
		{
			if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	
	}
	else if(hlRec.Mors.equals("S"))
		hlRec.Btyp = "S";


	hlRec.Hlfl = "Y"; //"Y" on an insert
	
	hlRec.Webadt = "Y";				
}
 
Example 32
Project: openMAXIMS   File: ApplicationUsersImpl.java   Source Code and License 5 votes vote down vote up
private void copyUserToDto(App_users userRec, AppUser user)
{
	App_usersRecord rec = userRec.DataCollection.get(0);
	
	if (user.getId() != null)
		rec.User_id = user.getId() + "";
	rec.Uname = user.getUsername();		
	rec.Upass = user.getPassword();
	rec.Dbname = "imsuser";
	rec.Dbpass = "welcome";
	if (user.getSystemInformation().getCreationDateTime() != null)			
	{
		rec.Rdat = new Date(user.getSystemInformation().getCreationDateTime()).toString(DateFormat.ISO);
		rec.Rtim = new DateTime(user.getSystemInformation().getCreationDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Rusr = getUserId(user.getSystemInformation().getCreationUser());

	if (user.getSystemInformation().getLastUpdateDateTime() != null)
	{
		rec.Udat = new Date(user.getSystemInformation().getLastUpdateDateTime()).toString(DateFormat.ISO);
		rec.Utim = new DateTime(user.getSystemInformation().getLastUpdateDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Uusr = getUserId(user.getSystemInformation().getLastUpdateUser());
	rec.Comment = "Replicated from Maxims Web Application";
	
	if (user.getEffectiveFrom() != null)
		rec.Effr = new Date(user.getEffectiveFrom()).toString(DateFormat.ISO);	
	else
		rec.Effr = new Date().toString(DateFormat.ISO);
	if (user.getEffectiveTo() != null)
		rec.Efft = new Date(user.getEffectiveTo()).toString(DateFormat.ISO);			
	if (user.getPwdExpDate() != null)
		rec.Passwd_exp = new Date(user.getPwdExpDate()).toString(DateFormat.ISO);			
	if (user.isIsActive() != null && user.isIsActive().booleanValue() == false)
		rec.Active = "I";
	else
		rec.Active = "A";		
}
 
Example 33
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
/**
 * @param tmDummySlot
 * @return
 */
private Time roundTimeIfRequired(Time tmDummySlot)
{
	int round = 5;
	int intTime = Integer.parseInt(tmDummySlot.toString(TimeFormat.FLAT4));
	//check for remainder if there is a remainder rounding is required
	if(!(intTime%round == 0))
	{
		double result = Math.round((intTime+5) /round) * round;		
		String prepend = "";
		
		// WDEV-13221
		// Reversed conditions to correctly prepend
		if(intTime < 1)
			prepend = "0000";
		else if(intTime < 10)
			prepend = "000";
		else if(intTime < 100)
			prepend = "00";
		else if(intTime < 1000)
			prepend = "0";

		
		int res = (int) result;
		
		String timeVal = prepend + res;
		timeVal = correctSixtyMinHourIfNeeded(timeVal);
		
		timeVal = timeVal.substring(0,2) + ":" + timeVal.substring(2,4);
		
		tmDummySlot = new Time(String.valueOf(timeVal));
	}
	return tmDummySlot;
}
 
Example 34
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private void populateInstance(CareContextShortVo voCareContext)
{		
	clearScreen();
	if (voCareContext != null)
	{	
		SkinAssessmentCollection skinAssVOCollection = domain.listSkinAssessment(voCareContext);
		if (skinAssVOCollection != null)
		{
			skinAssVOCollection = skinAssVOCollection.sort(SortOrder.DESCENDING);
			
			form.bNew().setEnabled(false);
			form.btnNext().setEnabled(false);
			form.btnPrevious().setEnabled(false);
			clearCombos();
			
			//String dateTime = "";
			form.comboBoxAssessment().clear();
			for(int i=0; i<skinAssVOCollection.size(); i++)
			{
				if(skinAssVOCollection.get(i).getDateTimeInitiated() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getDate() != null && 
				   skinAssVOCollection.get(i).getDateTimeInitiated().getTime() != null)
					form.comboBoxAssessment().newRow(skinAssVOCollection.get(i), skinAssVOCollection.get(i).getDateTimeInitiated().getDate().toString(DateFormat.STANDARD) + " / " + skinAssVOCollection.get(i).getDateTimeInitiated().getTime().toString(TimeFormat.DEFAULT));			
			}
			
			if(form.comboBoxAssessment().getValues() != null && form.comboBoxAssessment().getValues().size() > 0)
			{
				if(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment() != null)
					form.comboBoxAssessment().setValue(form.getGlobalContext().COE.SkinBodyChart.getSelectedSkinAssessment());
				else
					form.comboBoxAssessment().setValue((SkinAssessment)form.comboBoxAssessment().getValues().get(0));
				refreshAssessment();
			}
		}
	}
	else
		form.getLocalContext().setSkinAssessment(null);
}
 
Example 35
Project: openmaxims-linux   File: DTOHelper.java   Source Code and License 5 votes vote down vote up
public static String convertToDtoTime(java.util.Date javaDate) 
{
	if(javaDate == null)
		throw new CodingRuntimeException("javaDate cannot be null in method convertToDtoTime");
	
	DateTime imsDate = new DateTime(javaDate); 
	return imsDate.getTime().toString(TimeFormat.FLAT4);
}
 
Example 36
Project: openmaxims-linux   File: BedInfoDialogImpl.java   Source Code and License 5 votes vote down vote up
private void copyHomeleaveToDto(Homeleave homeLeaveRec, HomeLeaveVo voHomeLeave, InPatientEpisodeADTVo inpatientEpisode)
{
	HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
 	
	hlRec.Pkey = getPatientIdValue(inpatientEpisode, PatIdType.PKEY);
	hlRec.Hospnum = getPatientIdValue(inpatientEpisode, PatIdType.HOSPNUM);

	InpatientEpisode doInpat = InPatientEpisodeADTVoAssembler.extractInpatientEpisode(getDomainFactory(), inpatientEpisode);
	hlRec.Rescode = doInpat.getPasEvent() != null && doInpat.getPasEvent().getLocation() != null ? doInpat.getPasEvent().getLocation().getExtCode(TaxonomyType.PAS.getID()) : null;
	hlRec.Mors = DTOHelper.getPasMapping(doInpat.getWardType());

	hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
	hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

	hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
	hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";
	if(hlRec.Mors.equals("M"))
	{
		if(doInpat.getPasEvent().getPatient().getSex() != null)
		{
			if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doInpat.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	
	}
	else if(hlRec.Mors.equals("S"))
		hlRec.Btyp = "S";


	hlRec.Hlfl = "Y"; //"Y" on an insert
	
	hlRec.Webadt = "Y";				
}
 
Example 37
Project: openmaxims-linux   File: BedAdmissionComponentImpl.java   Source Code and License 5 votes vote down vote up
private void copyHomeLeaveToDto(Homeleave homeLeaveRec, AdmissionDetail doAdmissionDetail, HomeLeaveVo voHomeLeave) 
	{		
		HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
	 	
		hlRec.Pkey = getPatientIdValue(doAdmissionDetail, PatIdType.PKEY);
		hlRec.Hospnum = getPatientIdValue(doAdmissionDetail, PatIdType.HOSPNUM);

		hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
		hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

		hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
		hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";

		hlRec.Rescode = doAdmissionDetail.getWard() != null ? doAdmissionDetail.getWard().getExtCode(TaxonomyType.PAS.getID()) : null;
		hlRec.Mors = DTOHelper.getPasMapping(doAdmissionDetail.getWardType());
		if(hlRec.Mors.equals("M"))
		{
			if(doAdmissionDetail.getPasEvent().getPatient().getSex() != null)
			{
				if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
					hlRec.Btyp = "M";
				else if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
					hlRec.Btyp = "F";
				else
					//defaulting Male for unknown sex
					hlRec.Btyp = "M";
			}
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";	
		}
		else if(hlRec.Mors.equals("S"))
			hlRec.Btyp = "S";

		hlRec.Returndt = voHomeLeave.getDateReturnedFromHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateReturnedFromHomeLeave().getDate()) : "";
		hlRec.Returntm = voHomeLeave.getTimeReturnedFromHomeLeaveIsNotNull() ? voHomeLeave.getTimeReturnedFromHomeLeave().toString(TimeFormat.FLAT4) : "";
		
//		if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
//			hlRec.Cflup = rec.Rescode;
		
		if (voHomeLeave.getID_HomeLeaveIsNotNull())
			hlRec.Hlfl = "N"; //"N" on an update
		else
			hlRec.Hlfl = "Y"; //"Y" on an insert
		hlRec.Webadt = "Y";				
	}
 
Example 38
Project: openmaxims-linux   File: ApplicationUsersImpl.java   Source Code and License 5 votes vote down vote up
private void copyUserToDto(App_users userRec, AppUser user)
{
	App_usersRecord rec = userRec.DataCollection.get(0);
	
	if (user.getId() != null)
		rec.User_id = user.getId() + "";
	rec.Uname = user.getUsername();		
	rec.Upass = user.getPassword();
	rec.Dbname = "imsuser";
	rec.Dbpass = "welcome";
	if (user.getSystemInformation().getCreationDateTime() != null)			
	{
		rec.Rdat = new Date(user.getSystemInformation().getCreationDateTime()).toString(DateFormat.ISO);
		rec.Rtim = new DateTime(user.getSystemInformation().getCreationDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Rusr = getUserId(user.getSystemInformation().getCreationUser());

	if (user.getSystemInformation().getLastUpdateDateTime() != null)
	{
		rec.Udat = new Date(user.getSystemInformation().getLastUpdateDateTime()).toString(DateFormat.ISO);
		rec.Utim = new DateTime(user.getSystemInformation().getLastUpdateDateTime()).getTime().toString(TimeFormat.FLAT6);
	}
	rec.Uusr = getUserId(user.getSystemInformation().getLastUpdateUser());
	rec.Comment = "Replicated from Maxims Web Application";
	
	if (user.getEffectiveFrom() != null)
		rec.Effr = new Date(user.getEffectiveFrom()).toString(DateFormat.ISO);	
	else
		rec.Effr = new Date().toString(DateFormat.ISO);
	if (user.getEffectiveTo() != null)
		rec.Efft = new Date(user.getEffectiveTo()).toString(DateFormat.ISO);			
	if (user.getPwdExpDate() != null)
		rec.Passwd_exp = new Date(user.getPwdExpDate()).toString(DateFormat.ISO);			
	if (user.isIsActive() != null && user.isIsActive().booleanValue() == false)
		rec.Active = "I";
	else
		rec.Active = "A";		
}
 
Example 39
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private String getTooltip(AdmisSpineExamVo spineAdmisExam, MskSpineExamFindingVo findingVO)
{
	StringBuffer tooltip = new StringBuffer();
	String cr = "<br>";

	tooltip.append(label[0]);
	//Date/Time
	/*if(spineAdmisExam.getMskExam().getClinicalContact().getRecordingDateTimeIsNotNull())
	{
		tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getRecordingDateTime().getDate().toString(DateFormat.STANDARD));
		tooltip.append("; ");
		tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getRecordingDateTime().getTime().toString(TimeFormat.DEFAULT));
		tooltip.append("hrs");
	}*/
	if(spineAdmisExam.getMskExam().getClinicalContactIsNotNull())
	{
		if(spineAdmisExam.getMskExam().getClinicalContact().getStartDateTimeIsNotNull())
		{
			tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getStartDateTime().getDate().toString(DateFormat.STANDARD));
			tooltip.append("; ");
			tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getStartDateTime().getTime().toString(TimeFormat.DEFAULT));
			tooltip.append("hrs");
		}
	}
		
	tooltip.append(cr);
	
	tooltip.append(label[1]);
	//HCP
	//if(spineAdmisExam.getMskExam().getClinicalContact().getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull())
	//	tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getCareContext().getEpisodeOfCare().getResponsibleHCP().toString());
	if(spineAdmisExam.getMskExam().getClinicalContactIsNotNull())
	{
		if(spineAdmisExam.getMskExam().getClinicalContact().getSeenByIsNotNull())
			tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getSeenBy().toString());
	}
	
	tooltip.append(cr);
	
	//Finding
	tooltip.append(label[2]);
	if(findingVO.getFindingTypeIsNotNull())
		tooltip.append(findingVO.getFindingType().getText());
	tooltip.append(cr);
	
	//Site
	tooltip.append(label[3]);
	tooltip.append(findingVO.getSpineSiteNameIsNotNull()?findingVO.getSpineSiteName():"");
	tooltip.append(cr);
			
	return tooltip.toString();
}
 
Example 40
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
/**
 * @param docDetailVo
 */
private void populateScreenFromData(CorrespondenceDetailsVo voDocumentDetails)
{
	if (null == voDocumentDetails)
		return;

	if (voDocumentDetails.getCategoriesIsNotNull())
		populateCategoryDetails(voDocumentDetails.getCategories());

	// recipients
	if (voDocumentDetails.getRecipientsIsNotNull())
		populateRecipients(voDocumentDetails.getRecipients());

	// special interest
	if (voDocumentDetails.getSpecialInterestIsNotNull())
	{
		form.cmbType().setValue(voDocumentDetails.getSpecialInterest());
		form.chkSpecialInterest().setValue(true);
	}
	else
	{
		form.chkSpecialInterest().setValue(false);
	}

	// List template categories
	if (voDocumentDetails.getCurrentDocumentIsNotNull() && voDocumentDetails.getCurrentDocument().getTemplateIsNotNull())
	{
		// first time to load template catedories for this correspondence
		form.pnlTitle().setValue("Correspondence Details  -   Template : " + voDocumentDetails.getCurrentDocument().getTemplate().getName());
		if (voDocumentDetails.getCategoriesIsNotNull())
			populateScreenFromDataTemplateCategoryTexts(voDocumentDetails.getCategories(), voDocumentDetails.getCurrentDocument().getTemplate());
		else
			loadCategoriesForTemplate(voDocumentDetails.getCurrentDocument().getTemplate());
	}

	// signed by
	if (voDocumentDetails.getSignedByIsNotNull())
	{
		MedicLiteVo voLiteMedic = voDocumentDetails.getSignedBy();
		if (voLiteMedic != null)
		{
			form.qmbSignedBy().setValue(voLiteMedic);
			form.qmbSignedBy().setEditedText(voLiteMedic.getMos().getName().toShortForm());
			form.qmbSignedBy().setTooltip(voLiteMedic.getMos().getName().toShortForm());
		}
	}

	setCurrentStatusImage(voDocumentDetails.getCurrentStatus());

	if (voDocumentDetails.getCurrentStatusIsNotNull())
		form.getLocalContext().setlastDocumentStatus(voDocumentDetails.getCurrentStatus());

	PasEventVo voPasEvent = form.getLocalContext().getpasEventVo();
	if (voPasEvent != null)
	{
		form.ctnPatientDetails().txtContactNo().setValue(voPasEvent.getPasEventIdIsNotNull() ? voPasEvent.getPasEventId() : "");
		form.ctnPatientDetails().txtClinicDate().setValue(voPasEvent.getEventDateTimeIsNotNull() ? voPasEvent.getEventDateTime().getDate().toString(DateFormat.STANDARD) : "");
		form.ctnPatientDetails().txtClinicTime().setValue(voPasEvent.getEventDateTimeIsNotNull() ? voPasEvent.getEventDateTime().getTime().toString(TimeFormat.DEFAULT) : "");
	}

	populateScreenPatientInfoFromData(voDocumentDetails, voPasEvent);
	/*
	 * if (voPatient.getGpIsNotNull()) populateGPDetails(voPatient.getGp()); }
	 */
}
 
Example 41
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private boolean populateInstance(CareContextShortVo voContext,boolean bListRecords)
{
	clearScreen();
	
	if (voContext != null)
	{	

		PainAssessmentCollection assmtCollection;
		PainAssessment painAss;
		
		
		form.btnNew().setEnabled(false);
		form.btnNext().setEnabled(false);
		form.btnPrevious().setEnabled(false);
		
		//List the assessment if they were not listed before.
		if(bListRecords || form.getLocalContext().getPainAssessments() == null)
		{ 
			assmtCollection = domain.listPain(voContext);
			assmtCollection.sort(SortOrder.DESCENDING);
			form.getLocalContext().setPainAssessments(assmtCollection);
		}
		else
		{
			//Get the assessment from the context
			assmtCollection = form.getLocalContext().getPainAssessments();
		}
				
		if(assmtCollection != null)
		{
			for(int i=0; i<assmtCollection.size(); i++)
			{
				painAss = assmtCollection.get(i); 
				//Assessment Date/Time
				if(painAss.getDateTimeInitiated() != null && painAss.getDateTimeInitiated().getDate() != null && painAss.getDateTimeInitiated().getTime() != null)
					form.cmbAssessment().newRow(painAss, painAss.getDateTimeInitiated().getDate().toString(DateFormat.STANDARD) + " / " + painAss.getDateTimeInitiated().getTime().toString(TimeFormat.DEFAULT));
			}
		}
		//Set the current value in the combo
		if(form.cmbAssessment().getValues() != null && form.cmbAssessment().getValues().size() > 0)
		{
			//Set the context value or the first
			if(form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO() != null)
				form.cmbAssessment().setValue(form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO());
			else
				form.cmbAssessment().setValue((PainAssessment)form.cmbAssessment().getValues().get(0));
			
			if(form.cmbAssessment().getValue() != null)
				refreshSite();
		}
	}
	
	return true;
}
 
Example 42
Project: AvoinApotti   File: DTOHelper.java   Source Code and License 4 votes vote down vote up
public static String convertToDtoTime(String time)
{
	Time lTime = new Time(time);
	return lTime.toString(TimeFormat.FLAT4);
}
 
Example 43
Project: AvoinApotti   File: BedInfoDialogImpl.java   Source Code and License 4 votes vote down vote up
private void copyHomeLeaveToDto(Homeleave homeLeaveRec, AdmissionDetail doAdmissionDetail, HomeLeaveVo voHomeLeave) 
	{		
		HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
	 	
		hlRec.Pkey = getPatientIdValue(doAdmissionDetail, PatIdType.PKEY);
		hlRec.Hospnum = getPatientIdValue(doAdmissionDetail, PatIdType.HOSPNUM);

		hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
		hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

		hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
		hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";

		hlRec.Rescode = doAdmissionDetail.getWard() != null ? doAdmissionDetail.getWard().getExtCode(TaxonomyType.PAS.getID()) : null;
		hlRec.Mors = DTOHelper.getPasMapping(doAdmissionDetail.getWardType());
		if(doAdmissionDetail.getPasEvent().getPatient().getSex() != null)
		{
			if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	

		hlRec.Returndt = voHomeLeave.getDateReturnedFromHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateReturnedFromHomeLeave().getDate()) : "";
		hlRec.Returntm = voHomeLeave.getTimeReturnedFromHomeLeaveIsNotNull() ? voHomeLeave.getTimeReturnedFromHomeLeave().toString(TimeFormat.FLAT4) : "";
		
//		if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
//			hlRec.Cflup = rec.Rescode;
		
		if (voHomeLeave.getID_HomeLeaveIsNotNull())
			hlRec.Hlfl = "N"; //"N" on an update
		else
			hlRec.Hlfl = "Y"; //"Y" on an insert
		
		hlRec.Webadt = "Y";				
	}
 
Example 44
Project: AvoinApotti   File: BedAdmissionComponentImpl.java   Source Code and License 4 votes vote down vote up
private void copyHomeLeaveToDto(Homeleave homeLeaveRec, AdmissionDetail doAdmissionDetail, HomeLeaveVo voHomeLeave) 
	{		
		HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
	 	
		hlRec.Pkey = getPatientIdValue(doAdmissionDetail, PatIdType.PKEY);
		hlRec.Hospnum = getPatientIdValue(doAdmissionDetail, PatIdType.HOSPNUM);

		hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
		hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

		hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
		hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";

		hlRec.Rescode = doAdmissionDetail.getWard() != null ? doAdmissionDetail.getWard().getExtCode(TaxonomyType.PAS.getID()) : null;
		hlRec.Mors = DTOHelper.getPasMapping(doAdmissionDetail.getWardType());
		if(hlRec.Mors.equals("M"))
		{
			if(doAdmissionDetail.getPasEvent().getPatient().getSex() != null)
			{
				if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
					hlRec.Btyp = "M";
				else if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
					hlRec.Btyp = "F";
				else
					//defaulting Male for unknown sex
					hlRec.Btyp = "M";
			}
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";	
		}
		else if(hlRec.Mors.equals("S"))
			hlRec.Btyp = "S";

		hlRec.Returndt = voHomeLeave.getDateReturnedFromHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateReturnedFromHomeLeave().getDate()) : "";
		hlRec.Returntm = voHomeLeave.getTimeReturnedFromHomeLeaveIsNotNull() ? voHomeLeave.getTimeReturnedFromHomeLeave().toString(TimeFormat.FLAT4) : "";
		
//		if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
//			hlRec.Cflup = rec.Rescode;
		
		if (voHomeLeave.getID_HomeLeaveIsNotNull())
			hlRec.Hlfl = "N"; //"N" on an update
		else
			hlRec.Hlfl = "Y"; //"Y" on an insert
		hlRec.Webadt = "Y";				
	}
 
Example 45
Project: AvoinApotti   File: V231NasMapper.java   Source Code and License 4 votes vote down vote up
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;
}
 
Example 46
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
public String toXML()
{
	if (frequency == null || startDateTime == null)
		return null;

	StringBuffer sb = new StringBuffer();

	sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
	sb.append("<trigger>");
	sb.append("<frequency>");
	sb.append(StringUtils.encodeXML(frequency));
	sb.append("</frequency>");
	sb.append("<startdatetime>");
	sb.append(StringUtils.encodeXML(startDateTime != null ? startDateTime.toString(DateTimeFormat.ISO) : ""));
	sb.append("</startdatetime>");
	sb.append("<stopdatetime>");
	sb.append(StringUtils.encodeXML(stopDateTime != null ? stopDateTime.toString(DateTimeFormat.ISO) : ""));
	sb.append("</stopdatetime>");
	sb.append("<days>");
	sb.append(days != null ? String.valueOf(days) : "");
	sb.append("</days>");
	sb.append("<hours>");
	sb.append(hours != null ? String.valueOf(hours) : "");
	sb.append("</hours>");
	sb.append("<minutes>");
	sb.append(minutes != null ? String.valueOf(minutes) : "");
	sb.append("</minutes>");
	sb.append("<weeks>");
	sb.append(weeks != null ? String.valueOf(weeks) : "");
	sb.append("</weeks>");
	sb.append("<mon>");
	sb.append(mon);
	sb.append("</mon>");
	sb.append("<tue>");
	sb.append(tue);
	sb.append("</tue>");
	sb.append("<wed>");
	sb.append(wed);
	sb.append("</wed>");
	sb.append("<thu>");
	sb.append(thu);
	sb.append("</thu>");
	sb.append("<fri>");
	sb.append(fri);
	sb.append("</fri>");
	sb.append("<sat>");
	sb.append(sat);
	sb.append("</sat>");
	sb.append("<sun>");
	sb.append(sun);
	sb.append("</sun>");
	sb.append("<dayofmonth>");
	sb.append(dayOfMonth != null ? String.valueOf(dayOfMonth) : "");
	sb.append("</dayofmonth>");
	sb.append("<timeofmonth>");
	sb.append(StringUtils.encodeXML(timeOfMonth != null ? timeOfMonth.toString(TimeFormat.FLAT4) : ""));
	sb.append("</timeofmonth>");
	
	sb.append("</trigger>");

	return sb.toString();
}
 
Example 47
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void initFromXML(String xmlTrigger) throws DocumentException, ParseException
{
	Document maindoc = getXmlDocument(xmlTrigger);

	Node node = maindoc.selectSingleNode("trigger/frequency");
	if(node != null)
		frequency = node.getStringValue();
	node = maindoc.selectSingleNode("trigger/startdatetime");
	if(node != null && node.getStringValue().length() > 0)
		startDateTime = new DateTime(node.getStringValue());
	node = maindoc.selectSingleNode("trigger/stopdatetime");
	if(node != null && node.getStringValue().length() > 0)
		stopDateTime = new DateTime(node.getStringValue());
	node = maindoc.selectSingleNode("trigger/days");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		days = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/hours");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		hours = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/minutes");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		minutes = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/weeks");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		weeks = new Integer(Integer.parseInt(node.getStringValue()));

	node = maindoc.selectSingleNode("trigger/mon");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		mon = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/tue");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		tue = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/wed");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		wed = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/thu");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		thu = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/fri");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		fri = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/sat");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		sat = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/sun");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		sun = node.getStringValue().equalsIgnoreCase("true") ? true : false;

	node = maindoc.selectSingleNode("trigger/dayofmonth");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		dayOfMonth = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/timeofmonth");
	if(node != null && node.getStringValue().length() > 0)
		timeOfMonth = new Time(node.getStringValue(), TimeFormat.FLAT4);
}
 
Example 48
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
public String toXML()
{
	if (frequency == null || frequency.length() == 0 || (days == null && weeks == null && weekly.equals(frequency)) || (startDateTime == null && !monthly.equals(frequency)))
		return null;

	StringBuffer sb = new StringBuffer();

	sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
	sb.append("<trigger>");
	sb.append("<frequency>");
	sb.append(StringUtils.encodeXML(frequency));
	sb.append("</frequency>");
	sb.append("<startdatetime>");
	sb.append(StringUtils.encodeXML(startDateTime != null ? startDateTime.toString(DateTimeFormat.ISO) : ""));
	sb.append("</startdatetime>");
	sb.append("<days>");
	sb.append(days != null ? String.valueOf(days) : "");
	sb.append("</days>");
	sb.append("<weeks>");
	sb.append(weeks != null ? String.valueOf(weeks) : "");
	sb.append("</weeks>");
	sb.append("<mon>");
	sb.append(mon);
	sb.append("</mon>");
	sb.append("<tue>");
	sb.append(tue);
	sb.append("</tue>");
	sb.append("<wed>");
	sb.append(wed);
	sb.append("</wed>");
	sb.append("<thu>");
	sb.append(thu);
	sb.append("</thu>");
	sb.append("<fri>");
	sb.append(fri);
	sb.append("</fri>");
	sb.append("<sat>");
	sb.append(sat);
	sb.append("</sat>");
	sb.append("<sun>");
	sb.append(sun);
	sb.append("</sun>");
	sb.append("<dayofmonth>");
	sb.append(dayOfMonth != null ? String.valueOf(dayOfMonth) : "");
	sb.append("</dayofmonth>");
	sb.append("<timeofmonth>");
	sb.append(StringUtils.encodeXML(timeOfMonth != null ? timeOfMonth.toString(TimeFormat.FLAT4) : ""));
	sb.append("</timeofmonth>");
	
	sb.append("<mins>");
	sb.append(mins != null ? String.valueOf(mins) : "");;
	sb.append("</mins>");
	
	sb.append("</trigger>");

	return sb.toString();
}
 
Example 49
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void initFromXML(String xmlTrigger) throws DocumentException, ParseException
{
	Document maindoc = getXmlDocument(xmlTrigger);

	Node node = maindoc.selectSingleNode("trigger/frequency");
	if(node != null)
		frequency = node.getStringValue();
	node = maindoc.selectSingleNode("trigger/startdatetime");
	if(node != null && node.getStringValue().length() > 0)
		startDateTime = new DateTime(node.getStringValue());
	node = maindoc.selectSingleNode("trigger/days");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		days = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/weeks");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		weeks = new Integer(Integer.parseInt(node.getStringValue()));

	node = maindoc.selectSingleNode("trigger/mon");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		mon = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/tue");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		tue = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/wed");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		wed = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/thu");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		thu = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/fri");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		fri = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/sat");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		sat = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/sun");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		sun = node.getStringValue().equalsIgnoreCase("true") ? true : false;

	node = maindoc.selectSingleNode("trigger/dayofmonth");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		dayOfMonth = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/timeofmonth");
	if(node != null && node.getStringValue().length() > 0)
		timeOfMonth = new Time(node.getStringValue(), TimeFormat.FLAT4);
	
	node = maindoc.selectSingleNode("trigger/mins");
	if(node != null && node.getStringValue().length() > 0)
		mins = new Integer(Integer.parseInt(node.getStringValue()));
}
 
Example 50
Project: AvoinApotti   File: Trigger.java   Source Code and License 4 votes vote down vote up
public String toXML()
{
	if (frequency == null || frequency.length() == 0 || (days == null && weeks == null && weekly.equals(frequency)) || (startDateTime == null && !monthly.equals(frequency)))
		return null;

	StringBuffer sb = new StringBuffer();

	sb.append("<?xml version=\"1.0\" encoding=\"UTF-8\" standalone=\"yes\"?>");
	sb.append("<trigger>");
	sb.append("<frequency>");
	sb.append(StringUtils.encodeXML(frequency));
	sb.append("</frequency>");
	sb.append("<startdatetime>");
	sb.append(StringUtils.encodeXML(startDateTime != null ? startDateTime.toString(DateTimeFormat.ISO) : ""));
	sb.append("</startdatetime>");
	sb.append("<days>");
	sb.append(days != null ? String.valueOf(days) : "");
	sb.append("</days>");
	sb.append("<weeks>");
	sb.append(weeks != null ? String.valueOf(weeks) : "");
	sb.append("</weeks>");
	sb.append("<mon>");
	sb.append(mon);
	sb.append("</mon>");
	sb.append("<tue>");
	sb.append(tue);
	sb.append("</tue>");
	sb.append("<wed>");
	sb.append(wed);
	sb.append("</wed>");
	sb.append("<thu>");
	sb.append(thu);
	sb.append("</thu>");
	sb.append("<fri>");
	sb.append(fri);
	sb.append("</fri>");
	sb.append("<sat>");
	sb.append(sat);
	sb.append("</sat>");
	sb.append("<sun>");
	sb.append(sun);
	sb.append("</sun>");
	sb.append("<dayofmonth>");
	sb.append(dayOfMonth != null ? String.valueOf(dayOfMonth) : "");
	sb.append("</dayofmonth>");
	sb.append("<timeofmonth>");
	sb.append(StringUtils.encodeXML(timeOfMonth != null ? timeOfMonth.toString(TimeFormat.FLAT4) : ""));
	sb.append("</timeofmonth>");

	sb.append("</trigger>");

	return sb.toString();
}
 
Example 51
Project: AvoinApotti   File: Trigger.java   Source Code and License 4 votes vote down vote up
private void initFromXML(String xmlTrigger) throws DocumentException, ParseException
{
	Document maindoc = getXmlDocument(xmlTrigger);

	Node node = maindoc.selectSingleNode("trigger/frequency");
	if(node != null)
		frequency = node.getStringValue();
	node = maindoc.selectSingleNode("trigger/startdatetime");
	if(node != null && node.getStringValue().length() > 0)
		startDateTime = new DateTime(node.getStringValue());
	node = maindoc.selectSingleNode("trigger/days");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		days = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/weeks");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		weeks = new Integer(Integer.parseInt(node.getStringValue()));

	node = maindoc.selectSingleNode("trigger/mon");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		mon = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/tue");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		tue = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/wed");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		wed = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/thu");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		thu = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/fri");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		fri = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/sat");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		sat = node.getStringValue().equalsIgnoreCase("true") ? true : false;
	node = maindoc.selectSingleNode("trigger/sun");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		sun = node.getStringValue().equalsIgnoreCase("true") ? true : false;

	node = maindoc.selectSingleNode("trigger/dayofmonth");
	if (node != null && node.getStringValue() != null && node.getStringValue().length() > 0)
		dayOfMonth = new Integer(Integer.parseInt(node.getStringValue()));
	node = maindoc.selectSingleNode("trigger/timeofmonth");
	if(node != null && node.getStringValue().length() > 0)
		timeOfMonth = new Time(node.getStringValue(), TimeFormat.FLAT4);
}
 
Example 52
Project: AvoinApotti   File: Logic.java   Source Code and License 4 votes vote down vote up
private void populateActionsDetails(Discharge dischargeVO)
{
	form.layerControl1().tab1().dateCommenced().setValue(dischargeVO.getDateCommenced());
	form.layerControl1().tab1().comDest().setValue(dischargeVO.getDestination());
	if (dischargeVO.getDateTimeDischarged() != null)
	{
		form.layerControl1().tab1().textBoxDate().setValue(dischargeVO.getDateTimeDischarged().getDate().toString(DateFormat.STANDARD));
		form.layerControl1().tab1().textBoxTime().setValue(dischargeVO.getDateTimeDischarged().getTime().toString(TimeFormat.DEFAULT));
	}
	if (dischargeVO.getHCP() != null)
		form.layerControl1().tab1().textBoxBy().setValue(dischargeVO.getHCP().toString());

	// Action List Grid
	if (dischargeVO.getActions() != null)
	{
		for (int i = 0; i < dischargeVO.getActions().size(); i++)
		{
			gridActionsRow row = null;
			for (int j = 0; j < form.layerControl1().tab1().gridActions().getRows().size(); j++)
			{
				row = form.layerControl1().tab1().gridActions().getRows().get(j);
				if (dischargeVO.getActions().get(i).getActionList().equals(row.getColAction()))
				{
					row.setColStatus(dischargeVO.getActions().get(i).getStatus().booleanValue());
					if (dischargeVO.getActions().get(i).getDate() != null)
						row.setColActionDate(dischargeVO.getActions().get(i).getDate().toString(DateFormat.STANDARD));
					if (dischargeVO.getActions().get(i).getHCP() != null)
					{
						row.setColBy(dischargeVO.getActions().get(i).getHCP().toString());
						row.setColByValue(dischargeVO.getActions().get(i).getHCP());

					}
					else
						row.setColByValue(null);

					row.setColDetails(dischargeVO.getActions().get(i).getDetails());
					row.setValue(dischargeVO.getActions().get(i));
					break;
				}
			}
		}
	}
}
 
Example 53
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private String getTooltip(AdmisSpineExamVo spineAdmisExam, MskSpineExamFindingVo findingVO)
{
	StringBuffer tooltip = new StringBuffer();
	String cr = "<br>";

	tooltip.append(label[0]);
	//Date/Time
	/*if(spineAdmisExam.getMskExam().getClinicalContact().getRecordingDateTimeIsNotNull())
	{
		tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getRecordingDateTime().getDate().toString(DateFormat.STANDARD));
		tooltip.append("; ");
		tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getRecordingDateTime().getTime().toString(TimeFormat.DEFAULT));
		tooltip.append("hrs");
	}*/
	if(spineAdmisExam.getMskExam().getClinicalContactIsNotNull())
	{
		if(spineAdmisExam.getMskExam().getClinicalContact().getStartDateTimeIsNotNull())
		{
			tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getStartDateTime().getDate().toString(DateFormat.STANDARD));
			tooltip.append("; ");
			tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getStartDateTime().getTime().toString(TimeFormat.DEFAULT));
			tooltip.append("hrs");
		}
	}
		
	tooltip.append(cr);
	
	tooltip.append(label[1]);
	//HCP
	//if(spineAdmisExam.getMskExam().getClinicalContact().getCareContext().getEpisodeOfCare().getResponsibleHCPIsNotNull())
	//	tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getCareContext().getEpisodeOfCare().getResponsibleHCP().toString());
	if(spineAdmisExam.getMskExam().getClinicalContactIsNotNull())
	{
		if(spineAdmisExam.getMskExam().getClinicalContact().getSeenByIsNotNull())
			tooltip.append(spineAdmisExam.getMskExam().getClinicalContact().getSeenBy().toString());
	}
	
	tooltip.append(cr);
	
	//Finding
	tooltip.append(label[2]);
	if(findingVO.getFindingTypeIsNotNull())
		tooltip.append(findingVO.getFindingType().getText());
	tooltip.append(cr);
	
	//Site
	tooltip.append(label[3]);
	tooltip.append(findingVO.getSpineSiteNameIsNotNull()?findingVO.getSpineSiteName():"");
	tooltip.append(cr);
			
	return tooltip.toString();
}
 
Example 54
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
/**
 * @param docDetailVo
 */
private void populateScreenFromData(CorrespondenceDetailsVo voDocumentDetails)
{
	if (null == voDocumentDetails)
		return;

	if (voDocumentDetails.getCategoriesIsNotNull())
		populateCategoryDetails(voDocumentDetails.getCategories());

	// recipients
	if (voDocumentDetails.getRecipientsIsNotNull())
		populateRecipients(voDocumentDetails.getRecipients());

	// special interest
	if (voDocumentDetails.getSpecialInterestIsNotNull())
	{
		form.cmbType().setValue(voDocumentDetails.getSpecialInterest());
		form.chkSpecialInterest().setValue(true);
	}
	else
	{
		form.chkSpecialInterest().setValue(false);
	}

	// List template categories
	if (voDocumentDetails.getCurrentDocumentIsNotNull() && voDocumentDetails.getCurrentDocument().getTemplateIsNotNull())
	{
		// first time to load template catedories for this correspondence
		form.pnlTitle().setValue("Correspondence Details  -   Template : " + voDocumentDetails.getCurrentDocument().getTemplate().getName());
		if (voDocumentDetails.getCategoriesIsNotNull())
			populateScreenFromDataTemplateCategoryTexts(voDocumentDetails.getCategories(), voDocumentDetails.getCurrentDocument().getTemplate());
		else
			loadCategoriesForTemplate(voDocumentDetails.getCurrentDocument().getTemplate());
	}

	// signed by
	if (voDocumentDetails.getSignedByIsNotNull())
	{
		MedicLiteVo voLiteMedic = voDocumentDetails.getSignedBy();
		if (voLiteMedic != null)
		{
			form.qmbSignedBy().setValue(voLiteMedic);
			form.qmbSignedBy().setEditedText(voLiteMedic.getMos().getName().toShortForm());
			form.qmbSignedBy().setTooltip(voLiteMedic.getMos().getName().toShortForm());
		}
	}

	setCurrentStatusImage(voDocumentDetails.getCurrentStatus());

	if (voDocumentDetails.getCurrentStatusIsNotNull())
		form.getLocalContext().setlastDocumentStatus(voDocumentDetails.getCurrentStatus());

	PasEventVo voPasEvent = form.getLocalContext().getpasEventVo();
	if (voPasEvent != null)
	{
		form.ctnPatientDetails().txtContactNo().setValue(voPasEvent.getPasEventIdIsNotNull() ? voPasEvent.getPasEventId() : "");
		form.ctnPatientDetails().txtClinicDate().setValue(voPasEvent.getEventDateTimeIsNotNull() ? voPasEvent.getEventDateTime().getDate().toString(DateFormat.STANDARD) : "");
		form.ctnPatientDetails().txtClinicTime().setValue(voPasEvent.getEventDateTimeIsNotNull() ? voPasEvent.getEventDateTime().getTime().toString(TimeFormat.DEFAULT) : "");
	}

	populateScreenPatientInfoFromData(voDocumentDetails, voPasEvent);
	/*
	 * if (voPatient.getGpIsNotNull()) populateGPDetails(voPatient.getGp()); }
	 */
}
 
Example 55
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private boolean populateInstance(CareContextShortVo voContext,boolean bListRecords)
{
	clearScreen();
	
	if (voContext != null)
	{	

		PainAssessmentCollection assmtCollection;
		PainAssessment painAss;
		
		
		form.btnNew().setEnabled(false);
		form.btnNext().setEnabled(false);
		form.btnPrevious().setEnabled(false);
		
		//List the assessment if they were not listed before.
		if(bListRecords || form.getLocalContext().getPainAssessments() == null)
		{ 
			assmtCollection = domain.listPain(voContext);
			assmtCollection.sort(SortOrder.DESCENDING);
			form.getLocalContext().setPainAssessments(assmtCollection);
		}
		else
		{
			//Get the assessment from the context
			assmtCollection = form.getLocalContext().getPainAssessments();
		}
				
		if(assmtCollection != null)
		{
			for(int i=0; i<assmtCollection.size(); i++)
			{
				painAss = assmtCollection.get(i); 
				//Assessment Date/Time
				if(painAss.getDateTimeInitiated() != null && painAss.getDateTimeInitiated().getDate() != null && painAss.getDateTimeInitiated().getTime() != null)
					form.cmbAssessment().newRow(painAss, painAss.getDateTimeInitiated().getDate().toString(DateFormat.STANDARD) + " / " + painAss.getDateTimeInitiated().getTime().toString(TimeFormat.DEFAULT));
			}
		}
		//Set the current value in the combo
		if(form.cmbAssessment().getValues() != null && form.cmbAssessment().getValues().size() > 0)
		{
			//Set the context value or the first
			if(form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO() != null)
				form.cmbAssessment().setValue(form.getGlobalContext().COE.PainBodyChart.getPainAssessmentVO());
			else
				form.cmbAssessment().setValue((PainAssessment)form.cmbAssessment().getValues().get(0));
			
			if(form.cmbAssessment().getValue() != null)
				refreshSite();
		}
	}
	
	return true;
}
 
Example 56
Project: openMAXIMS   File: DTOHelper.java   Source Code and License 4 votes vote down vote up
public static String convertToDtoTime(String time)
{
	Time lTime = new Time(time);
	return lTime.toString(TimeFormat.FLAT4);
}
 
Example 57
Project: openMAXIMS   File: BedInfoDialogImpl.java   Source Code and License 4 votes vote down vote up
private void copyHomeLeaveToDto(Homeleave homeLeaveRec, AdmissionDetail doAdmissionDetail, HomeLeaveVo voHomeLeave) 
	{		
		HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);
	 	
		hlRec.Pkey = getPatientIdValue(doAdmissionDetail, PatIdType.PKEY);
		hlRec.Hospnum = getPatientIdValue(doAdmissionDetail, PatIdType.HOSPNUM);

		hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
		hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

		hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
		hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";

		hlRec.Rescode = doAdmissionDetail.getWard() != null ? doAdmissionDetail.getWard().getExtCode(TaxonomyType.PAS.getID()) : null;
		hlRec.Mors = DTOHelper.getPasMapping(doAdmissionDetail.getWardType());
		if(doAdmissionDetail.getPasEvent().getPatient().getSex() != null)
		{
			if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	

		hlRec.Returndt = voHomeLeave.getDateReturnedFromHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateReturnedFromHomeLeave().getDate()) : "";
		hlRec.Returntm = voHomeLeave.getTimeReturnedFromHomeLeaveIsNotNull() ? voHomeLeave.getTimeReturnedFromHomeLeave().toString(TimeFormat.FLAT4) : "";
		
//		if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
//			hlRec.Cflup = rec.Rescode;
		
		if (voHomeLeave.getID_HomeLeaveIsNotNull())
			hlRec.Hlfl = "N"; //"N" on an update
		else
			hlRec.Hlfl = "Y"; //"Y" on an insert
		
		hlRec.Webadt = "Y";				
	}
 
Example 58
Project: openMAXIMS   File: BedAdmissionComponentImpl.java   Source Code and License 4 votes vote down vote up
private void copyHomeLeaveToDto(Homeleave homeLeaveRec, AdmissionDetail doAdmissionDetail, HomeLeaveVo voHomeLeave) 
{		
	HomeleaveRecord hlRec = homeLeaveRec.DataCollection.get(0);

	hlRec.Pkey = getPatientIdValue(doAdmissionDetail, PatIdType.PKEY);
	hlRec.Hospnum = getPatientIdValue(doAdmissionDetail, PatIdType.HOSPNUM);

	hlRec.Leavedt = voHomeLeave.getDateOnHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateOnHomeLeave().getDate()) : "";
	hlRec.Leavetm =  voHomeLeave.getTimeOnHomeLeaveIsNotNull() ? voHomeLeave.getTimeOnHomeLeave().toString(TimeFormat.FLAT4) : "";

	hlRec.Exdt = voHomeLeave.getExpectedDateOfReturnIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getExpectedDateOfReturn().getDate()) : "";
	hlRec.Extm = voHomeLeave.getExpectedTimeOfReturnIsNotNull() ? voHomeLeave.getExpectedTimeOfReturn().toString(TimeFormat.FLAT4) : "";

	hlRec.Rescode = doAdmissionDetail.getWard() != null ? doAdmissionDetail.getWard().getExtCode(TaxonomyType.PAS.getID()) : null;
	hlRec.Mors = DTOHelper.getPasMapping(doAdmissionDetail.getWardType());
	if(hlRec.Mors.equals("M"))
	{
		if(doAdmissionDetail.getPasEvent().getPatient().getSex() != null)
		{
			if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.MALE)))
				hlRec.Btyp = "M";
			else if(doAdmissionDetail.getPasEvent().getPatient().getSex().equals(getDomLookup(Sex.FEMALE)))
				hlRec.Btyp = "F";
			else
				//defaulting Male for unknown sex
				hlRec.Btyp = "M";
		}
		else
			//defaulting Male for unknown sex
			hlRec.Btyp = "M";	
	}
	else if(hlRec.Mors.equals("S"))
		hlRec.Btyp = "S";

	hlRec.Returndt = voHomeLeave.getDateReturnedFromHomeLeaveIsNotNull() ? DTOHelper.convertToDtoDate(voHomeLeave.getDateReturnedFromHomeLeave().getDate()) : "";
	hlRec.Returntm = voHomeLeave.getTimeReturnedFromHomeLeaveIsNotNull() ? voHomeLeave.getTimeReturnedFromHomeLeave().toString(TimeFormat.FLAT4) : "";

	//		if(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("CCO"))
	//			hlRec.Cflup = rec.Rescode;

	if (voHomeLeave.getID_HomeLeaveIsNotNull())
		hlRec.Hlfl = "N"; //"N" on an update
	else
		hlRec.Hlfl = "Y"; //"Y" on an insert
	hlRec.Webadt = "Y";				
}
 
Example 59
Project: openMAXIMS   File: V231NasMapper.java   Source Code and License 4 votes vote down vote up
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;
}
 
Example 60
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private int  Open()
{
	// This method should return the number of records retrieved on success or a negative value on failure.
	if(form.getGlobalContext().CcoSched.Trasport.getAppointmentHeaderIDIsNotNull() == false)
		return -1;
	
	Sd_appt app = (Sd_appt) domain.getDTOInstance(Sd_appt.class);
	app.Filter.clear();
	app.Filter.Appt_head_id = form.getGlobalContext().CcoSched.Trasport.getAppointmentHeaderID();
	Result result = app.get();
	if (result != null)
	{
		engine.showMessage(result.getMessage());
		return -1;
	}

	form.getLocalContext().setapptDTO(app);
	
	for(int x=0; x<app.DataCollection.get(0).Appt_idCollection.count(); x++)
	{
		Date date = GetDateFromString(app.DataCollection.get(0).Appt_idCollection.get(x).Appt_dt);
		//SqlDateTime date = DTOdate.IsNull ? SqlDateTime.Null : new SqlDateTime(DTOdate.Value);
		//Display only future dates
		if(date.compareTo(new Date()) >= 0)
		{	
			GenForm.MainGridRow row = form.MainGrid().getRows().newRow();	
			row.setDate(date.toString(DateFormat.STANDARD));
			Time appTm = GetTimeFromString(app.DataCollection.get(0).Appt_idCollection.get(x).App_stm);
			//date = Dtodate.IsNull ? SqlDateTime.Null : new SqlDateTime(Dtodate.Value);
			row.setAppointmentTime(appTm == null?"":appTm.toString(TimeFormat.DEFAULT));
			Time attTm = GetTimeFromString(app.DataCollection.get(0).Appt_idCollection.get(x).Att_tm);
			//date = Dtodate.IsNull ? SqlDateTime.Null : new SqlDateTime(Dtodate.Value);
			row.setAttendanceTime(attTm==null?"":attTm.toString(TimeFormat.DEFAULT));//toString()Value.ToString("t");
			row.setTransport(getTransport(app.DataCollection.get(0).Appt_idCollection.get(x).Trans_typ));
			//this.setMainGridTransportLookupValue(row, getIntFromString(app.DataCollection.get(0).Appt_idCollection.get(x).Trans_typ));
			row.setValue(app.DataCollection.get(0).Appt_idCollection.get(x).Appt_id);
		}
	}

	if(app.DataCollection.get(0).Tran_arrnge_req != null && app.DataCollection.get(0).Tran_arrnge_req.equalsIgnoreCase("Y"))
		form.FurtherTransport().setValue(true);

	form.Comments().setValue(app.DataCollection.get(0).Transp_cmnt);

	if (form.MainGrid().getRows().size() > 0) 
	{
		//Equivalent to setCurrentSelection = 0;
		form.MainGrid().setValue(form.MainGrid().getRows().get(0).getValue());
		form.Save().setEnabled(true);
	}
	else
		form.Save().setEnabled(false);

	return 0; // replace this value with the number of records retrieved.
}