Java Code Examples for ims.core.resource.people.vo.MedicRefVo

The following are top voted examples for showing how to use ims.core.resource.people.vo.MedicRefVo. 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: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		engine.open(form.getForms().Emergency.EDSeenByAndCompleteDialog);//WDEV-16816
		return;
	}
	else
	{
		//WDEV-16816
		// Attempt to save created SeenByHcp to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 2
Project: AvoinApotti   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistAndTriageVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		//engine.open(form.getForms().Emergency.AllocatedMedicDialog);
		return;
	}
	else
	{
		// Attempt to save created AllocatedMedic to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))//WDEV-16816
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 3
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private PasEventRepatriationVo createPasEvent(PatientRefVo patient, DateTime eventDateTime, MedicRefVo consultant, LocationRefVo location, ServiceLiteVo service, SourceOfReferral sourceOfReferral)
{
	if (patient == null || patient.getID_Patient() == null)
		throw new IllegalArgumentException("'patient' - argument cannot be null or not saved into database.");
	
	if (eventDateTime == null)
		throw new IllegalArgumentException("'eventDateTime' - cannot be null or not saved into database.");
	
	PasEventRepatriationVo pasEvent = new PasEventRepatriationVo();
	
	// Prepare random seed
	Random rand = new Random(System.currentTimeMillis());
	
	pasEvent.setEventDateTime(eventDateTime);
	pasEvent.setPatient(patient);
	pasEvent.setPasEventId(patient.getID_Patient().toString() + eventDateTime.toString(DateTimeFormat.ISO) + "_" + (new DateTime()).toString(DateTimeFormat.ISO) + "_" + rand.nextInt(1000000000));
	pasEvent.setConsultant(consultant);
	pasEvent.setLocation(location);
	pasEvent.setSpecialty(service != null ? service.getSpecialty() : null);
	pasEvent.setSourceOfReferral(sourceOfReferral);
	pasEvent.setEventType(PasEventType.EMERGENCY);
	pasEvent.setService(service); //WDEV-20900

	return pasEvent;
}
 
Example 4
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		engine.open(form.getForms().Emergency.EDSeenByAndCompleteDialog);//WDEV-16816
		return;
	}
	else
	{
		//WDEV-16816
		// Attempt to save created SeenByHcp to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 5
Project: openMAXIMS   File: VoMapper.java   Source Code and License 6 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1, ProviderSystemVo providerSystem) //WDEV-20278
	{
		MedicRefVo hcp=null;
		XCN[] xcns = pv1.getReferringDoctor();
		if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
		{
			hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
		}
		if(hcp==null&&xcns.length>1&&xcns[1]!=null)
		{
			//WDEV-20278
//			hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
			hcp = populateMedicRefFromXCN(xcns[1], providerSystem.getCodeSystem()); //WDEV-20278
		}
		return hcp;
	}
 
Example 6
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		engine.open(form.getForms().Emergency.EDSeenByAndCompleteDialog);//WDEV-16816
		return;
	}
	else
	{
		//WDEV-16816
		// Attempt to save created SeenByHcp to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 7
Project: openMAXIMS   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistAndTriageVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		//engine.open(form.getForms().Emergency.AllocatedMedicDialog);
		return;
	}
	else
	{
		// Attempt to save created AllocatedMedic to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))//WDEV-16816
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 8
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		engine.open(form.getForms().Emergency.EDSeenByAndCompleteDialog);//WDEV-16816
		return;
	}
	else
	{
		//WDEV-16816
		// Attempt to save created SeenByHcp to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 9
Project: openmaxims-linux   File: Logic.java   Source Code and License 6 votes vote down vote up
private void startClinicianAssessment(TrackingForClinicianWorklistAndTriageVo tracking)
{
	if (tracking == null)
		return;
	
	HcpLiteVo hcpUser = (HcpLiteVo) domain.getHcpLiteUser();
	
	if (hcpUser == null || !HcpDisType.MEDICAL.equals(hcpUser.getHcpType()))
	{
		//engine.open(form.getForms().Emergency.AllocatedMedicDialog);
		return;
	}
	else
	{
		// Attempt to save created AllocatedMedic to tracking
		if (saveSeenByHcp(tracking, new MedicRefVo(hcpUser.getID_Hcp(), hcpUser.getVersion_Hcp())))//WDEV-16816
		{
			// Refresh screen
			open();
		}
	}
}
 
Example 10
Project: AvoinApotti   File: PatientListsImpl.java   Source Code and License 5 votes vote down vote up
public InpatientEpisodeVoCollection listInPatients(LocationRefVo refVoWard, MedicRefVo refVoMedic) 
{		
	DomainFactory factory = getDomainFactory();
	String hql;
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = " from InpatientEpisode ip "; 
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";
	if (refVoWard != null)
	{
		condStr.append(andStr + " ip.pasEvent.location.id = :ward");
		markers.add("ward");
		values.add(refVoWard.getID_Location());
		andStr = " and ";
	}
	if (refVoMedic != null)
	{
		condStr.append(andStr + " ip.pasEvent.consultant.id = :cons");
		markers.add("cons");
		values.add(refVoMedic.getID_Hcp());
		andStr = " and ";
	}


	if (andStr.equals(" and "))
	{
		hql += " where ";
	}
	
	hql += condStr.toString();
	List ips = factory.find(hql, markers, values);
	
	return InpatientEpisodeVoAssembler.createInpatientEpisodeVoCollectionFromInpatientEpisode(ips);
}
 
Example 11
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean saveSeenByHcp(TrackingForClinicianWorklistVo tracking, MedicRefVo medic)
{
	try
	{
		// Create the SeenByHcp record to be associated with tracking
		SeenByHCPVo seenByHcp = new SeenByHCPVo();
		seenByHcp.setPatient(tracking.getPatient());
		seenByHcp.setEpisode(tracking.getEpisode().getEpisodeOfCare());
		seenByHcp.setAttendance(tracking.getAttendance().getCareContext());
		seenByHcp.setTrackingArea(tracking.getCurrentArea());

		seenByHcp.setAllocatedDateTime(new DateTime());			
		seenByHcp.setAllocatedMedic((MedicVo)domain.getHcpUser());		
		seenByHcp.setSeenDateTime(new DateTime());
		
		// Validate SeenByHcp record
		String[] errors = seenByHcp.validate();

		if (errors != null && errors.length > 0)
		{
			engine.showErrors(errors);
			return false;
		}

		form.getLocalContext().setSelectedWaitingPatient(domain.saveTrackingSeenByHcp(tracking, seenByHcp));

		return true;
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
}
 
Example 12
Project: AvoinApotti   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean saveSeenByHcp(TrackingForClinicianWorklistAndTriageVo tracking, MedicRefVo medic)
{
	try
	{
		// Create the SeenByHcp record to be associated with tracking
		SeenByHCPVo seenByHcp = new SeenByHCPVo();
		seenByHcp.setPatient(tracking.getPatient());
		seenByHcp.setEpisode(tracking.getEpisode().getEpisodeOfCare());
		seenByHcp.setAttendance(tracking.getAttendance().getCareContext());
		seenByHcp.setTrackingArea(tracking.getCurrentArea());

		seenByHcp.setAllocatedDateTime(new DateTime());			
		seenByHcp.setAllocatedMedic((MedicVo)domain.getHcpUser());		
		seenByHcp.setSeenDateTime(new DateTime());
		
		// Validate SeenByHcp record
		String[] errors = seenByHcp.validate();

		if (errors != null && errors.length > 0)
		{
			engine.showErrors(errors);
			return false;
		}

		form.getLocalContext().setSelectedWaitingPatient(domain.saveTrackingSeenByHcp(tracking, seenByHcp));

		return true;
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
}
 
Example 13
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1)
{
	MedicRefVo hcp=null;
	XCN[] xcns = pv1.getReferringDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 14
Project: AvoinApotti   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 15
Project: AvoinApotti   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public MedicRefVo getMedicRefByTaxonomyType(String extCode,TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return new MedicRefVo(domMos.getHcp().getId(),domMos.getHcp().getVersion()); 
	}
}
 
Example 16
Project: AvoinApotti   File: EDischargeListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 17
Project: AvoinApotti   File: EDischargePreViewComponentImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 18
Project: AvoinApotti   File: EDischargeSTHKListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 19
Project: openMAXIMS   File: PatientListsImpl.java   Source Code and License 5 votes vote down vote up
public InpatientEpisodeVoCollection listInPatients(LocationRefVo refVoWard, MedicRefVo refVoMedic) 
{		
	DomainFactory factory = getDomainFactory();
	String hql;
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = " from InpatientEpisode ip "; 
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";
	if (refVoWard != null)
	{
		condStr.append(andStr + " ip.pasEvent.location.id = :ward");
		markers.add("ward");
		values.add(refVoWard.getID_Location());
		andStr = " and ";
	}
	if (refVoMedic != null)
	{
		condStr.append(andStr + " ip.pasEvent.consultant.id = :cons");
		markers.add("cons");
		values.add(refVoMedic.getID_Hcp());
		andStr = " and ";
	}


	if (andStr.equals(" and "))
	{
		hql += " where ";
	}
	
	hql += condStr.toString();
	List ips = factory.find(hql, markers, values);
	
	return InpatientEpisodeVoAssembler.createInpatientEpisodeVoCollectionFromInpatientEpisode(ips);
}
 
Example 20
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
protected void OnBtnAdmissionDetailsSave() throws PresentationLogicException {
	setAdmissionDetailsPanelRW(false,EpisodeType.ADMISSION);
	if(form.grdCurrentAdmissionDetails().getSelectedRow()!=null&&form.grdCurrentAdmissionDetails().getSelectedRow().getValue()!=null)
	{
		InpatientEpisodeMaintenanceVo episode = form.grdCurrentAdmissionDetails().getSelectedRow().getValue();
		if(form.ctn1().cmbSourceOfAdmission()!=null)
			episode.setSourceOfAdmission(form.ctn1().cmbSourceOfAdmission().getValue());
		if(form.ctn1().cmbMethodOfAdmission()!=null)
			episode.setMethodOfAdmission(form.ctn1().cmbMethodOfAdmission().getValue());
		//episode.setReasonForAdmission(form.ctn1().txtReasonForAdmission().getValue());
		if(form.ctn1().cmbSourceOfReferral()!=null
			&&episode.getPasEvent()!=null)
		{
			episode.getPasEvent().setSourceOfReferral(form.ctn1().cmbSourceOfReferral().getValue());
		}
		if(form.ctn1().ccConsultant().getValue()!=null)
		{
			episode.setConsultantHcpRef(new MedicRefVo(form.ctn1().ccConsultant().getValue().getIMosId(),0));
		}
		if(form.ctn1().ccReferringConsultant().getValue()!=null)
		{
			episode.setReferringHcpRef(new MedicRefVo(form.ctn1().ccReferringConsultant().getValue().getIMosHcpId(),0));
		}
		try {
			domain.saveAdmissionDetails(episode);
			open();
		} catch (StaleObjectException e) {
			e.printStackTrace();
			engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
			open();
			return;
		}
		enableStayButtons(true);
	}
}
 
Example 21
Project: openMAXIMS   File: AdmitToWardImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicFull(MedicRefVo medic)
{
	if (medic == null || medic.getID_Hcp() == null)
		return null;
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(Medic.class, medic.getID_Hcp()));
}
 
Example 22
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean saveSeenByHcp(TrackingForClinicianWorklistVo tracking, MedicRefVo medic)
{
	try
	{
		// Create the SeenByHcp record to be associated with tracking
		SeenByHCPVo seenByHcp = new SeenByHCPVo();
		seenByHcp.setPatient(tracking.getPatient());
		seenByHcp.setEpisode(tracking.getEpisode().getEpisodeOfCare());
		seenByHcp.setAttendance(tracking.getAttendance().getCareContext());
		seenByHcp.setTrackingArea(tracking.getCurrentArea());

		seenByHcp.setAllocatedDateTime(new DateTime());			
		seenByHcp.setAllocatedMedic((MedicVo)domain.getHcpUser());		
		seenByHcp.setSeenDateTime(new DateTime());
		
		// Validate SeenByHcp record
		String[] errors = seenByHcp.validate();

		if (errors != null && errors.length > 0)
		{
			engine.showErrors(errors);
			return false;
		}

		form.getLocalContext().setSelectedWaitingPatient(domain.saveTrackingSeenByHcp(tracking, seenByHcp));

		return true;
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
}
 
Example 23
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 24
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public MedicRefVo getMedicRefByTaxonomyType(String extCode,TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return new MedicRefVo(domMos.getHcp().getId(),domMos.getHcp().getVersion()); 
	}
}
 
Example 25
Project: openMAXIMS   File: EDischargeListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 26
Project: openMAXIMS   File: EDischargePreViewComponentImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 27
Project: openMAXIMS   File: EDischargeSTHKListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 28
Project: openMAXIMS   File: PatientListsImpl.java   Source Code and License 5 votes vote down vote up
public InpatientEpisodeVoCollection listInPatients(LocationRefVo refVoWard, MedicRefVo refVoMedic) 
{		
	DomainFactory factory = getDomainFactory();
	String hql;
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = " from InpatientEpisode ip "; 
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";
	if (refVoWard != null)
	{
		condStr.append(andStr + " ip.pasEvent.location.id = :ward");
		markers.add("ward");
		values.add(refVoWard.getID_Location());
		andStr = " and ";
	}
	if (refVoMedic != null)
	{
		condStr.append(andStr + " ip.pasEvent.consultant.id = :cons");
		markers.add("cons");
		values.add(refVoMedic.getID_Hcp());
		andStr = " and ";
	}


	if (andStr.equals(" and "))
	{
		hql += " where ";
	}
	
	hql += condStr.toString();
	List ips = factory.find(hql, markers, values);
	
	return InpatientEpisodeVoAssembler.createInpatientEpisodeVoCollectionFromInpatientEpisode(ips);
}
 
Example 29
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean saveSeenByHcp(TrackingForClinicianWorklistVo tracking, MedicRefVo medic)
{
	try
	{
		// Create the SeenByHcp record to be associated with tracking
		SeenByHCPVo seenByHcp = new SeenByHCPVo();
		seenByHcp.setPatient(tracking.getPatient());
		seenByHcp.setEpisode(tracking.getEpisode().getEpisodeOfCare());
		seenByHcp.setAttendance(tracking.getAttendance().getCareContext());
		seenByHcp.setTrackingArea(tracking.getCurrentArea());

		seenByHcp.setAllocatedDateTime(new DateTime());			
		seenByHcp.setAllocatedMedic((MedicVo)domain.getHcpUser());		
		seenByHcp.setSeenDateTime(new DateTime());
		
		// Validate SeenByHcp record
		String[] errors = seenByHcp.validate();

		if (errors != null && errors.length > 0)
		{
			engine.showErrors(errors);
			return false;
		}

		form.getLocalContext().setSelectedWaitingPatient(domain.saveTrackingSeenByHcp(tracking, seenByHcp));

		return true;
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
}
 
Example 30
Project: openMAXIMS   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean saveSeenByHcp(TrackingForClinicianWorklistAndTriageVo tracking, MedicRefVo medic)
{
	try
	{
		// Create the SeenByHcp record to be associated with tracking
		SeenByHCPVo seenByHcp = new SeenByHCPVo();
		seenByHcp.setPatient(tracking.getPatient());
		seenByHcp.setEpisode(tracking.getEpisode().getEpisodeOfCare());
		seenByHcp.setAttendance(tracking.getAttendance().getCareContext());
		seenByHcp.setTrackingArea(tracking.getCurrentArea());

		seenByHcp.setAllocatedDateTime(new DateTime());			
		seenByHcp.setAllocatedMedic((MedicVo)domain.getHcpUser());		
		seenByHcp.setSeenDateTime(new DateTime());
		
		// Validate SeenByHcp record
		String[] errors = seenByHcp.validate();

		if (errors != null && errors.length > 0)
		{
			engine.showErrors(errors);
			return false;
		}

		form.getLocalContext().setSelectedWaitingPatient(domain.saveTrackingSeenByHcp(tracking, seenByHcp));

		return true;
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
}
 
Example 31
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1)
{
	MedicRefVo hcp=null;
	XCN[] xcns = pv1.getReferringDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 32
Project: openMAXIMS   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 33
Project: openMAXIMS   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public MedicRefVo getMedicRefByTaxonomyType(String extCode,TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return new MedicRefVo(domMos.getHcp().getId(),domMos.getHcp().getVersion()); 
	}
}
 
Example 34
Project: openMAXIMS   File: EDischargeListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 35
Project: openMAXIMS   File: EDischargePreViewComponentImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 36
Project: openMAXIMS   File: EDischargeSTHKListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 37
Project: openmaxims-linux   File: PatientListsImpl.java   Source Code and License 5 votes vote down vote up
public InpatientEpisodeVoCollection listInPatients(LocationRefVo refVoWard, MedicRefVo refVoMedic) 
{		
	DomainFactory factory = getDomainFactory();
	String hql;
	ArrayList markers = new ArrayList();
	ArrayList values = new ArrayList();
	
	hql = " from InpatientEpisode ip "; 
	StringBuffer condStr = new StringBuffer();
	String andStr = " ";
	if (refVoWard != null)
	{
		condStr.append(andStr + " ip.pasEvent.location.id = :ward");
		markers.add("ward");
		values.add(refVoWard.getID_Location());
		andStr = " and ";
	}
	if (refVoMedic != null)
	{
		condStr.append(andStr + " ip.pasEvent.consultant.id = :cons");
		markers.add("cons");
		values.add(refVoMedic.getID_Hcp());
		andStr = " and ";
	}


	if (andStr.equals(" and "))
	{
		hql += " where ";
	}
	
	hql += condStr.toString();
	List ips = factory.find(hql, markers, values);
	
	return InpatientEpisodeVoAssembler.createInpatientEpisodeVoCollectionFromInpatientEpisode(ips);
}
 
Example 38
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean saveSeenByHcp(TrackingForClinicianWorklistVo tracking, MedicRefVo medic)
{
	try
	{
		// Create the SeenByHcp record to be associated with tracking
		SeenByHCPVo seenByHcp = new SeenByHCPVo();
		seenByHcp.setPatient(tracking.getPatient());
		seenByHcp.setEpisode(tracking.getEpisode().getEpisodeOfCare());
		seenByHcp.setAttendance(tracking.getAttendance().getCareContext());
		seenByHcp.setTrackingArea(tracking.getCurrentArea());

		seenByHcp.setAllocatedDateTime(new DateTime());			
		seenByHcp.setAllocatedMedic((MedicVo)domain.getHcpUser());		
		seenByHcp.setSeenDateTime(new DateTime());
		
		// Validate SeenByHcp record
		String[] errors = seenByHcp.validate();

		if (errors != null && errors.length > 0)
		{
			engine.showErrors(errors);
			return false;
		}

		form.getLocalContext().setSelectedWaitingPatient(domain.saveTrackingSeenByHcp(tracking, seenByHcp));

		return true;
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
}
 
Example 39
Project: openmaxims-linux   File: Logic.java   Source Code and License 5 votes vote down vote up
private boolean saveSeenByHcp(TrackingForClinicianWorklistAndTriageVo tracking, MedicRefVo medic)
{
	try
	{
		// Create the SeenByHcp record to be associated with tracking
		SeenByHCPVo seenByHcp = new SeenByHCPVo();
		seenByHcp.setPatient(tracking.getPatient());
		seenByHcp.setEpisode(tracking.getEpisode().getEpisodeOfCare());
		seenByHcp.setAttendance(tracking.getAttendance().getCareContext());
		seenByHcp.setTrackingArea(tracking.getCurrentArea());

		seenByHcp.setAllocatedDateTime(new DateTime());			
		seenByHcp.setAllocatedMedic((MedicVo)domain.getHcpUser());		
		seenByHcp.setSeenDateTime(new DateTime());
		
		// Validate SeenByHcp record
		String[] errors = seenByHcp.validate();

		if (errors != null && errors.length > 0)
		{
			engine.showErrors(errors);
			return false;
		}

		form.getLocalContext().setSelectedWaitingPatient(domain.saveTrackingSeenByHcp(tracking, seenByHcp));

		return true;
	}
	catch (StaleObjectException e)
	{
		engine.showMessage(ConfigFlag.UI.STALE_OBJECT_MESSAGE.getValue());
		open();
		return false;
	}
}
 
Example 40
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected MedicRefVo getReferringConsultant(PV1 pv1)
{
	MedicRefVo hcp=null;
	XCN[] xcns = pv1.getReferringDoctor();
	if (xcns!=null&&xcns.length>0&&xcns[0]!=null)
	{
		hcp= populateMedicRefFromXCN(xcns[0],TaxonomyType.NAT_CONS_CODE);
	}
	if(hcp==null&&xcns.length>1&&xcns[1]!=null)
	{
		hcp=populateMedicRefFromXCN(xcns[1],TaxonomyType.PAS);
	}
	return hcp;
}
 
Example 41
Project: openmaxims-linux   File: VoMapper.java   Source Code and License 5 votes vote down vote up
protected final MedicRefVo populateMedicRefFromXCN(XCN xcn, TaxonomyType taxType)
{
	String code = xcn.getIDNumber().getValue();
	if (code != null)
	{
		return mosAdmin.getMedicRefByTaxonomyType(code, taxType);
	}
	return null;
}
 
Example 42
Project: openmaxims-linux   File: MosAdminImpl.java   Source Code and License 5 votes vote down vote up
public MedicRefVo getMedicRefByTaxonomyType(String extCode,TaxonomyType taxType)
{
	MemberOfStaff domMos = getDomMosByTaxonomyType(extCode, taxType);
	if (domMos == null)
		return null;
	else
	{
		return new MedicRefVo(domMos.getHcp().getId(),domMos.getHcp().getVersion()); 
	}
}
 
Example 43
Project: openmaxims-linux   File: EDischargeListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 44
Project: openmaxims-linux   File: EDischargePreViewComponentImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 45
Project: openmaxims-linux   File: EDischargeSTHKListImpl.java   Source Code and License 5 votes vote down vote up
public MedicVo getMedicVo(MedicRefVo medic) 
{
	if(medic == null || medic.getID_Hcp() == null)
		throw new CodingRuntimeException("MedicRefVo is null or id not provided for getMedicVo");
	
	return MedicVoAssembler.create((Medic) getDomainFactory().getDomainObject(medic));
}
 
Example 46
Project: AvoinApotti   File: AdtTransferDialogImpl.java   Source Code and License 4 votes vote down vote up
public void transferInpatient(PatientRefVo patient, LocationRefVo ward, MedicRefVo consultant) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	ADT adt = (ADT)getDomainImpl(ADTImpl.class);
	adt.transferPatient(patient, consultant, ward);		
}
 
Example 47
Project: openMAXIMS   File: Logic.java   Source Code and License 4 votes vote down vote up
private AdmissionDetailVo createAdmissionDetails(PatientLite_IdentifiersVo patient)
{
	// Fill in data into PatientElectiveList.TCIDetails.AdmissionDetail record - create a new one if needed
	AdmissionDetailVo admissionDetails = new AdmissionDetailVo();

		PasEventAdmitVo pasEvent = new PasEventAdmitVo();
		
		if (form.qmbConsultant().getValue() != null) //WDEV-23376
		{	
			MedicVo medicVo = domain.getMedic(form.qmbConsultant().getValue().toHcpRefVo());
			pasEvent.setConsultant(new MedicRefVo(medicVo.getID_Hcp(), medicVo.getVersion_Hcp()));
		}	
		else
			pasEvent.setConsultant(null);
		
		pasEvent.setEventDateTime(form.dtimAdmit().getValue());
		pasEvent.setEventType(PasEventType.EMERGENCY);
		pasEvent.setLocation(form.cmbWard().getValue());
		patient.setWard(form.cmbWard().getValue());
		pasEvent.setPatient(patient);
		pasEvent.setSpecialty(form.cmbSpecialty().getValue());
		pasEvent.setPasEventId(patient.getID_Patient().toString() + pasEvent.getEventDateTime().toString(DateTimeFormat.ISO));
		pasEvent.setSourceOfReferral(form.cmbSourceOfReferral().getValue());
		pasEvent.setService(form.qmbService().getValue()); //WDEV-20910
		
		admissionDetails.setPasEvent(pasEvent);
	
	
	admissionDetails.setAdmissionDateTime(form.dtimAdmit().getValue());
	admissionDetails.setWard(form.cmbWard().getValue());
	admissionDetails.setAdmissionWard(form.cmbWard().getValue());
	
	if (form.getGlobalContext().Core.getSelectedBedSpaceState() != null)
		admissionDetails.setBed(form.getGlobalContext().Core.getSelectedBedSpaceState().getBedSpace());

	if (form.qmbConsultant().getValue() != null)
		admissionDetails.setConsultant(domain.getMedic(new HcpRefVo(form.qmbConsultant().getValue().getIMosHcpId(), 0)));
	else
		admissionDetails.setConsultant(null);

	admissionDetails.setSpecialty(form.cmbSpecialty().getValue());
	admissionDetails.setWardType(form.cmbWardType().getValue());
	admissionDetails.setMethodOfAdmission(form.cmbMethod().getValue());
	admissionDetails.setSourceOfAdmission(form.cmbSource().getValue());
	admissionDetails.setReasonForAdmission(form.txtReason().getValue());
	admissionDetails.setEstDischargeDate(ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS") ? form.dtimEstDischarge().getValue() : (form.dteEstDischarge().getValue() != null ? new DateTime(form.dteEstDischarge().getValue(), new Time(0,0)) : null));
	admissionDetails.setIsChaplainRequired(form.chkChaplain().getValue());
	admissionDetails.setSourceOfEmergencyReferral(form.cmbSourceOfEmergencyReferral().getValue());
	admissionDetails.setReferringConsultant((MedicVo) form.ccReferringConsultant().getValue());
	admissionDetails.setPatientStatus(form.cmbPatientStatus().getValue());
	admissionDetails.setAnticipatedStay(form.intAntStay().getValue());
	admissionDetails.setIsMaternity(form.chkIsMaternity().getValue());
	//WDEV-20323 On Admission, service needs to be saved alongside the specialty - this will be saved in Admission Detail and Consultant Stay
	admissionDetails.setService(form.qmbService().getValue()); //WDEV-20323
	if (ConfigFlag.UI.BED_INFO_UI_TYPE.getValue().equals("MAXIMS"))
	{	
		admissionDetails.setSelfAdmitPatient(form.chkSelfAdmitPatient().getValue());
		admissionDetails.setHealthyLodgerDetails(form.getGlobalContext().Core.getHealthyLodgerDetails());
	}	
	
	admissionDetails.setUpdateCFL(form.CaseFolderYesNo().getValue() != null && form.CaseFolderYesNo().getValue().equals(CaseFolderYesNoEnumeration.rdoYes));

	return admissionDetails;
}
 
Example 48
Project: openMAXIMS   File: AdtTransferDialogImpl.java   Source Code and License 4 votes vote down vote up
public void transferInpatient(PatientRefVo patient, LocationRefVo ward, MedicRefVo consultant) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	ADT adt = (ADT)getDomainImpl(ADTImpl.class);
	adt.transferPatient(patient, consultant, ward);		
}
 
Example 49
Project: openMAXIMS   File: AdtTransferDialogImpl.java   Source Code and License 4 votes vote down vote up
public void transferInpatient(PatientRefVo patient, LocationRefVo ward, MedicRefVo consultant) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	ADT adt = (ADT)getDomainImpl(ADTImpl.class);
	adt.transferPatient(patient, consultant, ward);		
}
 
Example 50
Project: openmaxims-linux   File: AdtTransferDialogImpl.java   Source Code and License 4 votes vote down vote up
public void transferInpatient(PatientRefVo patient, LocationRefVo ward, MedicRefVo consultant) throws ims.domain.exceptions.DomainInterfaceException, ims.domain.exceptions.StaleObjectException
{
	ADT adt = (ADT)getDomainImpl(ADTImpl.class);
	adt.transferPatient(patient, consultant, ward);		
}