Java Code Examples for ims.core.admin.pas.domain.objects.PendingElectiveAdmission

The following are top voted examples for showing how to use ims.core.admin.pas.domain.objects.PendingElectiveAdmission. 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: ADTImpl.java   Source Code and License 6 votes vote down vote up
private PendingElectiveAdmission getDomPendingElectiveAdmission(Patient domPatient,
		PASEvent domEvent) 
{
	if (domPatient==null||null==domEvent||null==domEvent.getPasEventId())
		return null;
	DomainFactory factory = getDomainFactory();
	if (domEvent!=null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.patient = :pat and o.pasEvent.pasEventId = :pasEvent";
		
		List<?> lst = factory.find(hql, new String[]{"pat","pasEvent"}, new Object[]{domPatient,domEvent.getPasEventId()});
		if (lst != null && lst.size() == 1)
			return (PendingElectiveAdmission) lst.get(0);
	}
	return null;
}
 
Example 2
Project: AvoinApotti   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 6 votes vote down vote up
public PendingElectiveAdmissionHl7Vo saveDUMMYELECTIVEADMISSION(PendingElectiveAdmissionHl7Vo voToSave)
{
	if(voToSave == null || !voToSave.isValidated())
		throw new CodingRuntimeException("Object is null or has not been validated");
	
	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission domSocialHistory = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory,voToSave);
	try {
		factory.save(domSocialHistory);
	} catch (StaleObjectException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	return PendingElectiveAdmissionHl7VoAssembler.create(domSocialHistory);
}
 
Example 3
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 6 votes vote down vote up
private PendingElectiveAdmission getDomPendingElectiveAdmission(Patient domPatient,
		PASEvent domEvent) 
{
	if (domPatient==null||null==domEvent||null==domEvent.getPasEventId())
		return null;
	DomainFactory factory = getDomainFactory();
	if (domEvent!=null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.patient = :pat and o.pasEvent.pasEventId = :pasEvent";
		
		List<?> lst = factory.find(hql, new String[]{"pat","pasEvent"}, new Object[]{domPatient,domEvent.getPasEventId()});
		if (lst != null && lst.size() == 1)
			return (PendingElectiveAdmission) lst.get(0);
	}
	return null;
}
 
Example 4
Project: openMAXIMS   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 6 votes vote down vote up
public PendingElectiveAdmissionHl7Vo saveDUMMYELECTIVEADMISSION(PendingElectiveAdmissionHl7Vo voToSave)
{
	if(voToSave == null || !voToSave.isValidated())
		throw new CodingRuntimeException("Object is null or has not been validated");
	
	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission domSocialHistory = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory,voToSave);
	try {
		factory.save(domSocialHistory);
	} catch (StaleObjectException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	return PendingElectiveAdmissionHl7VoAssembler.create(domSocialHistory);
}
 
Example 5
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 6 votes vote down vote up
private PendingElectiveAdmission getDomPendingElectiveAdmission(Patient domPatient,
		PASEvent domEvent) 
{
	if (domPatient==null||null==domEvent||null==domEvent.getPasEventId())
		return null;
	DomainFactory factory = getDomainFactory();
	if (domEvent!=null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.patient = :pat and o.pasEvent.pasEventId = :pasEvent";
		
		List<?> lst = factory.find(hql, new String[]{"pat","pasEvent"}, new Object[]{domPatient,domEvent.getPasEventId()});
		if (lst != null && lst.size() == 1)
			return (PendingElectiveAdmission) lst.get(0);
	}
	return null;
}
 
Example 6
Project: openMAXIMS   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 6 votes vote down vote up
public PendingElectiveAdmissionHl7Vo saveDUMMYELECTIVEADMISSION(PendingElectiveAdmissionHl7Vo voToSave)
{
	if(voToSave == null || !voToSave.isValidated())
		throw new CodingRuntimeException("Object is null or has not been validated");
	
	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission domSocialHistory = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory,voToSave);
	try {
		factory.save(domSocialHistory);
	} catch (StaleObjectException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	return PendingElectiveAdmissionHl7VoAssembler.create(domSocialHistory);
}
 
Example 7
Project: openmaxims-linux   File: ADTImpl.java   Source Code and License 6 votes vote down vote up
private PendingElectiveAdmission getDomPendingElectiveAdmission(Patient domPatient,
		PASEvent domEvent) 
{
	if (domPatient==null||null==domEvent||null==domEvent.getPasEventId())
		return null;
	DomainFactory factory = getDomainFactory();
	if (domEvent!=null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.patient = :pat and o.pasEvent.pasEventId = :pasEvent";
		
		List<?> lst = factory.find(hql, new String[]{"pat","pasEvent"}, new Object[]{domPatient,domEvent.getPasEventId()});
		if (lst != null && lst.size() == 1)
			return (PendingElectiveAdmission) lst.get(0);
	}
	return null;
}
 
Example 8
Project: openmaxims-linux   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 6 votes vote down vote up
public PendingElectiveAdmissionHl7Vo saveDUMMYELECTIVEADMISSION(PendingElectiveAdmissionHl7Vo voToSave)
{
	if(voToSave == null || !voToSave.isValidated())
		throw new CodingRuntimeException("Object is null or has not been validated");
	
	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission domSocialHistory = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory,voToSave);
	try {
		factory.save(domSocialHistory);
	} catch (StaleObjectException e) {
		// TODO Auto-generated catch block
		e.printStackTrace();
	}
	
	return PendingElectiveAdmissionHl7VoAssembler.create(domSocialHistory);
}
 
Example 9
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo getPendingElectiveAdmission(
		PasEventVo pasEventVo) {
DomainFactory factory = getDomainFactory();
	
	PASEvent domEvent = PASEvent.getPASEventFrompasevent_unq1(factory, (Patient)factory.getDomainObject(Patient.class, pasEventVo.getPatient().getID_Patient()), pasEventVo.getPasEventId());
	if (domEvent != null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.id = :pasEvent";
		List<?> lst = factory.find(hql, new String[]{"pasEvent"}, new Object[]{domEvent.getId()});
		if (lst != null && lst.size() == 1)
			return PendingElectiveAdmissionHl7VoAssembler.create((PendingElectiveAdmission) lst.get(0));
	}
	
	return null;
	}
 
Example 10
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo recordPendingElectiveAdmission(
		PasEventVo pasEventVo,
		PendingElectiveAdmissionHl7Vo pendingElectiveAdmissionVo)
		throws StaleObjectException {
	if(!pasEventVo.isValidated())
	{
		throw new DomainRuntimeException("Pas Event VO has not been validated!");
	}
	if (null ==pendingElectiveAdmissionVo)
	{
		throw new DomainRuntimeException("Pending Elective Admission cannot be null");
	}

	if (!pendingElectiveAdmissionVo.isValidated())
	{
		throw new DomainRuntimeException("Pending Elective Admission Admit VO has not been validated!");
	}
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission peaDomain = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory, pendingElectiveAdmissionVo);
	if(null!=pendingElectiveAdmissionVo.getProcedures())
	{
		for (String procCode : pendingElectiveAdmissionVo.getProcedures()) 
		{
			Procedure proc = getProcedureFromTaxonomyMap(procCode,TaxonomyType.OPCS4);
			if(proc!=null)
				peaDomain.getProcedures().add(proc);
		}
	}
	
	factory.save(peaDomain);
	return PendingElectiveAdmissionHl7VoAssembler.create(peaDomain);
}
 
Example 11
Project: AvoinApotti   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 5 votes vote down vote up
public STHKPendingElectiveAdmissionListVo savePendingRecord(STHKPendingElectiveAdmissionListVo voPending) throws DomainInterfaceException, StaleObjectException 
{
	if (!voPending.isValidated())
		throw new CodingRuntimeException("Pending Record has not been validated");
	if(voPending == null)
		throw new CodingRuntimeException("Cannot save null STHKPendingElectiveAdmissionListVo");
	
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission doElective = STHKPendingElectiveAdmissionListVoAssembler.extractPendingElectiveAdmission(factory, voPending);
	factory.save(doElective);
	return (STHKPendingElectiveAdmissionListVoAssembler.create(doElective));		
}
 
Example 12
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo getPendingElectiveAdmission(
		PasEventVo pasEventVo) {
DomainFactory factory = getDomainFactory();
	
	PASEvent domEvent = PASEvent.getPASEventFrompasevent_unq1(factory, (Patient)factory.getDomainObject(Patient.class, pasEventVo.getPatient().getID_Patient()), pasEventVo.getPasEventId());
	if (domEvent != null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.id = :pasEvent";
		List<?> lst = factory.find(hql, new String[]{"pasEvent"}, new Object[]{domEvent.getId()});
		if (lst != null && lst.size() == 1)
			return PendingElectiveAdmissionHl7VoAssembler.create((PendingElectiveAdmission) lst.get(0));
	}
	
	return null;
	}
 
Example 13
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo recordPendingElectiveAdmission(
		PasEventVo pasEventVo,
		PendingElectiveAdmissionHl7Vo pendingElectiveAdmissionVo)
		throws StaleObjectException {
	if(!pasEventVo.isValidated())
	{
		throw new DomainRuntimeException("Pas Event VO has not been validated!");
	}
	if (null ==pendingElectiveAdmissionVo)
	{
		throw new DomainRuntimeException("Pending Elective Admission cannot be null");
	}

	if (!pendingElectiveAdmissionVo.isValidated())
	{
		throw new DomainRuntimeException("Pending Elective Admission Admit VO has not been validated!");
	}
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission peaDomain = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory, pendingElectiveAdmissionVo);
	if(null!=pendingElectiveAdmissionVo.getProcedures())
	{
		for (String procCode : pendingElectiveAdmissionVo.getProcedures()) 
		{
			Procedure proc = getProcedureFromTaxonomyMap(procCode,TaxonomyType.OPCS4);
			if(proc!=null)
				peaDomain.getProcedures().add(proc);
		}
	}
	
	factory.save(peaDomain);
	return PendingElectiveAdmissionHl7VoAssembler.create(peaDomain);
}
 
Example 14
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
private PendingElectiveAdmission getPendingElectiveAdmission(PASEvent pasEvent)
{
		DomainFactory factory = getDomainFactory();
		String hql = "from PendingElectiveAdmission pea where pea.pasEvent=:pasEvent";
		List<?> l = factory.find(hql,new String[]{"pasEvent"},new Object[]{pasEvent});
		if (l != null && l.size() > 0)
		{
			return (PendingElectiveAdmission)l.get(0);
		}
		return null;
}
 
Example 15
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
private boolean isElective(PendingElectiveAdmission domPEA)
{
if(domPEA!=null)
	return true;
else
	return false;
}
 
Example 16
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public void vteOnDischarge(ims.core.patient.domain.objects.Patient domPatient,ims.core.admin.pas.domain.objects.DischargedEpisode disDo, ims.core.admin.pas.domain.objects.InpatientEpisode ipDo) throws StaleObjectException
{
	if( ConfigFlag.UI.VTE_RISK_ASSESSMENT_FUNCTIONALITY.getValue())
	{
		DomainFactory factory= getDomainFactory();
		if(disDo.isWasTreatmentDeferred()!=null
				&&disDo.isWasTreatmentDeferred()
				&&ipDo.getVTERiskAssessment()!=null
				&&ipDo.getVTERiskAssessment().getContextType()!=null
				&&ipDo.getVTERiskAssessment().getContextType().equals(getDomLookup( VTEAssessmentContextType.PREOP)))
		{
			vteOnCancelAdmission(ipDo, domPatient);
		}
		else
		{
			disDo.setVTEAssessmentStatus(ipDo.getVTEAssessmentStatus());
			disDo.setVTERiskAssessment(ipDo.getVTERiskAssessment());
			disDo.setVTEAssessmentStatusReason(ipDo.getVTEAssessmentStatusReason());
			PatientSummaryRecord patientSummaryRecord = getSummaryRecord(domPatient);

			//WDEV-20611 if we have a Pending Elective Admission for the current pas event clear the patient summary record
			PendingElectiveAdmission pendingElectiveAdmission = getPendingElectiveAdmission(ipDo.getPasEvent());   
			
			if (patientSummaryRecord != null && disDo.getVTERiskAssessment()!= null && pendingElectiveAdmission != null)
			{
				patientSummaryRecord.setInpatientVTEAssessment(null);
				patientSummaryRecord.setPreOpVTEAssessment(null);
				patientSummaryRecord.setPreOpVTECompletedDate(null);
				patientSummaryRecord.setPreOpVTEValidationDate(null);
				factory.save(patientSummaryRecord);
			}
		}
	}
}
 
Example 17
Project: openMAXIMS   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 5 votes vote down vote up
public STHKPendingElectiveAdmissionListVo savePendingRecord(STHKPendingElectiveAdmissionListVo voPending) throws DomainInterfaceException, StaleObjectException 
{
	if (!voPending.isValidated())
		throw new CodingRuntimeException("Pending Record has not been validated");
	if(voPending == null)
		throw new CodingRuntimeException("Cannot save null STHKPendingElectiveAdmissionListVo");
	
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission doElective = STHKPendingElectiveAdmissionListVoAssembler.extractPendingElectiveAdmission(factory, voPending);
	factory.save(doElective);
	return (STHKPendingElectiveAdmissionListVoAssembler.create(doElective));		
}
 
Example 18
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo getPendingElectiveAdmission(
		PasEventVo pasEventVo) {
DomainFactory factory = getDomainFactory();
	
	PASEvent domEvent = PASEvent.getPASEventFrompasevent_unq1(factory, (Patient)factory.getDomainObject(Patient.class, pasEventVo.getPatient().getID_Patient()), pasEventVo.getPasEventId());
	if (domEvent != null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.id = :pasEvent";
		List<?> lst = factory.find(hql, new String[]{"pasEvent"}, new Object[]{domEvent.getId()});
		if (lst != null && lst.size() == 1)
			return PendingElectiveAdmissionHl7VoAssembler.create((PendingElectiveAdmission) lst.get(0));
	}
	
	return null;
	}
 
Example 19
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo recordPendingElectiveAdmission(
		PasEventVo pasEventVo,
		PendingElectiveAdmissionHl7Vo pendingElectiveAdmissionVo)
		throws StaleObjectException {
	if(!pasEventVo.isValidated())
	{
		throw new DomainRuntimeException("Pas Event VO has not been validated!");
	}
	if (null ==pendingElectiveAdmissionVo)
	{
		throw new DomainRuntimeException("Pending Elective Admission cannot be null");
	}

	if (!pendingElectiveAdmissionVo.isValidated())
	{
		throw new DomainRuntimeException("Pending Elective Admission Admit VO has not been validated!");
	}
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission peaDomain = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory, pendingElectiveAdmissionVo);
	if(null!=pendingElectiveAdmissionVo.getProcedures())
	{
		for (String procCode : pendingElectiveAdmissionVo.getProcedures()) 
		{
			Procedure proc = getProcedureFromTaxonomyMap(procCode,TaxonomyType.OPCS4);
			if(proc!=null)
				peaDomain.getProcedures().add(proc);
		}
	}
	
	factory.save(peaDomain);
	return PendingElectiveAdmissionHl7VoAssembler.create(peaDomain);
}
 
Example 20
Project: openMAXIMS   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 5 votes vote down vote up
public STHKPendingElectiveAdmissionListVo savePendingRecord(STHKPendingElectiveAdmissionListVo voPending) throws DomainInterfaceException, StaleObjectException 
{
	if (!voPending.isValidated())
		throw new CodingRuntimeException("Pending Record has not been validated");
	if(voPending == null)
		throw new CodingRuntimeException("Cannot save null STHKPendingElectiveAdmissionListVo");
	
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission doElective = STHKPendingElectiveAdmissionListVoAssembler.extractPendingElectiveAdmission(factory, voPending);
	factory.save(doElective);
	return (STHKPendingElectiveAdmissionListVoAssembler.create(doElective));		
}
 
Example 21
Project: openmaxims-linux   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo getPendingElectiveAdmission(
		PasEventVo pasEventVo) {
DomainFactory factory = getDomainFactory();
	
	PASEvent domEvent = PASEvent.getPASEventFrompasevent_unq1(factory, (Patient)factory.getDomainObject(Patient.class, pasEventVo.getPatient().getID_Patient()), pasEventVo.getPasEventId());
	if (domEvent != null)
	{
		String hql = " from PendingElectiveAdmission o where o.pasEvent.id = :pasEvent";
		List<?> lst = factory.find(hql, new String[]{"pasEvent"}, new Object[]{domEvent.getId()});
		if (lst != null && lst.size() == 1)
			return PendingElectiveAdmissionHl7VoAssembler.create((PendingElectiveAdmission) lst.get(0));
	}
	
	return null;
	}
 
Example 22
Project: openmaxims-linux   File: ADTImpl.java   Source Code and License 5 votes vote down vote up
public PendingElectiveAdmissionHl7Vo recordPendingElectiveAdmission(
		PasEventVo pasEventVo,
		PendingElectiveAdmissionHl7Vo pendingElectiveAdmissionVo)
		throws StaleObjectException {
	if(!pasEventVo.isValidated())
	{
		throw new DomainRuntimeException("Pas Event VO has not been validated!");
	}
	if (null ==pendingElectiveAdmissionVo)
	{
		throw new DomainRuntimeException("Pending Elective Admission cannot be null");
	}

	if (!pendingElectiveAdmissionVo.isValidated())
	{
		throw new DomainRuntimeException("Pending Elective Admission Admit VO has not been validated!");
	}
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission peaDomain = PendingElectiveAdmissionHl7VoAssembler.extractPendingElectiveAdmission(factory, pendingElectiveAdmissionVo);
	if(null!=pendingElectiveAdmissionVo.getProcedures())
	{
		for (String procCode : pendingElectiveAdmissionVo.getProcedures()) 
		{
			Procedure proc = getProcedureFromTaxonomyMap(procCode,TaxonomyType.OPCS4);
			if(proc!=null)
				peaDomain.getProcedures().add(proc);
		}
	}
	
	factory.save(peaDomain);
	return PendingElectiveAdmissionHl7VoAssembler.create(peaDomain);
}
 
Example 23
Project: openmaxims-linux   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 5 votes vote down vote up
public STHKPendingElectiveAdmissionListVo savePendingRecord(STHKPendingElectiveAdmissionListVo voPending) throws DomainInterfaceException, StaleObjectException 
{
	if (!voPending.isValidated())
		throw new CodingRuntimeException("Pending Record has not been validated");
	if(voPending == null)
		throw new CodingRuntimeException("Cannot save null STHKPendingElectiveAdmissionListVo");
	
	DomainFactory factory = getDomainFactory();
	
	PendingElectiveAdmission doElective = STHKPendingElectiveAdmissionListVoAssembler.extractPendingElectiveAdmission(factory, voPending);
	factory.save(doElective);
	return (STHKPendingElectiveAdmissionListVoAssembler.create(doElective));		
}
 
Example 24
Project: AvoinApotti   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}
 
Example 25
Project: AvoinApotti   File: ADTImpl.java   Source Code and License 4 votes vote down vote up
public InpatientEpisodeVo readmitPatient(PatientShort patVo, InpatientEpisodeVo episVo) throws StaleObjectException 
{
	if (!patVo.isValidated())
	{
		throw new CodingRuntimeException("Patient VO has not been validated!");
	}
	if (!episVo.isValidated())
	{
		throw new CodingRuntimeException("Episode VO has not been validated!");
	}
	if(patVo.getID_Patient() == null)
	{
		throw new CodingRuntimeException("Internal Patient ID must be valued.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	ims.core.patient.domain.objects.Patient domPatient =  (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patVo.getID_Patient().intValue());

	PASEvent domTCIPas=null;
	if (episVo!=null&&episVo.getPreAdmitNumber()!=null)
		domTCIPas = PASEvent.getPASEventFrompasevent_unq1(factory, domPatient, episVo.getPreAdmitNumber());
	
	PendingElectiveAdmission domPEA =  getDomPendingElectiveAdmission(domPatient,domTCIPas);
	if(null!=domPEA)
	{
		domPEA.setElectiveAdmissionStatus(getDomLookup(ElectiveAdmissionStatus.ADMITTED));
		factory.save(domPEA);
	}
	
	InpatientEpisode ipDo = InpatientEpisodeVoAssembler.extractInpatientEpisode(factory, episVo);
	if (ipDo!=null)
	{
		WardStay ws = new WardStay();
		ws.setTransferDateTime(ipDo.getAdmissionDateTime());
		if (ipDo.getPasEvent()!=null)
			ws.setWard(ipDo.getPasEvent().getLocation());
		ws.setWardType(ipDo.getWardType());
	
		if(ipDo.getPasEvent()!=null&&ipDo.getPasEvent().getConsultant()!=null)
		{
			ConsultantStay cs = new ConsultantStay();
			cs.setConsultant(ipDo.getPasEvent().getConsultant());
			cs.setTransferDateTime(ipDo.getAdmissionDateTime());
			ipDo.getConsultantStays().add(cs);
		}
		
		ipDo.getWardStays().add(ws);
	}
	factory.save(ipDo);
	
	AdmissionDetail ad = populateAdmissionDetailfromInpatientEpisode(ipDo,episVo, null);
	factory.save(ad);
	
	domPatient.setWard(ipDo.getPasEvent().getLocation());
	// WDEV-17867 - Set Current Responsible Clinician to Patient record
	domPatient.setCurrentResponsibleConsultant(ipDo.getPasEvent().getConsultant());
	factory.save(domPatient);
	
	return InpatientEpisodeVoAssembler.create(ipDo);
}
 
Example 26
Project: AvoinApotti   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 4 votes vote down vote up
public STHKPendingElectiveAdmissionListVo getCurrentPendingRecord(PendingElectiveAdmissionRefVo electiveRefVo) 
{
	DomainFactory factory = getDomainFactory();
	return STHKPendingElectiveAdmissionListVoAssembler.create((PendingElectiveAdmission) factory.getDomainObject(PendingElectiveAdmission.class, electiveRefVo.getID_PendingElectiveAdmission()));
}
 
Example 27
Project: openMAXIMS   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}
 
Example 28
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 4 votes vote down vote up
public InpatientEpisodeVo readmitPatient(PatientShort patVo, InpatientEpisodeVo episVo) throws StaleObjectException 
{
	if (!patVo.isValidated())
	{
		throw new CodingRuntimeException("Patient VO has not been validated!");
	}
	if (!episVo.isValidated())
	{
		throw new CodingRuntimeException("Episode VO has not been validated!");
	}
	if(patVo.getID_Patient() == null)
	{
		throw new CodingRuntimeException("Internal Patient ID must be valued.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	ims.core.patient.domain.objects.Patient domPatient =  (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patVo.getID_Patient().intValue());

	PASEvent domTCIPas=null;
	if (episVo!=null&&episVo.getPreAdmitNumber()!=null)
		domTCIPas = PASEvent.getPASEventFrompasevent_unq1(factory, domPatient, episVo.getPreAdmitNumber());
	
	PendingElectiveAdmission domPEA =  getDomPendingElectiveAdmission(domPatient,domTCIPas);
	if(null!=domPEA)
	{
		domPEA.setElectiveAdmissionStatus(getDomLookup(ElectiveAdmissionStatus.ADMITTED));
		factory.save(domPEA);
	}
	
	InpatientEpisode ipDo = InpatientEpisodeVoAssembler.extractInpatientEpisode(factory, episVo);
	if (ipDo!=null)
	{
		WardStay ws = new WardStay();
		ws.setTransferDateTime(ipDo.getAdmissionDateTime());
		if (ipDo.getPasEvent()!=null)
			ws.setWard(ipDo.getPasEvent().getLocation());
		ws.setWardType(ipDo.getWardType());
	
		if(ipDo.getPasEvent()!=null&&ipDo.getPasEvent().getConsultant()!=null)
		{
			ConsultantStay cs = new ConsultantStay();
			cs.setConsultant(ipDo.getPasEvent().getConsultant());
			cs.setTransferDateTime(ipDo.getAdmissionDateTime());
			cs.setSpecialty(ipDo.getPasEvent().getSpecialty());
			
			ipDo.getConsultantStays().add(cs);
		}
		
		ipDo.getWardStays().add(ws);
	}
	factory.save(ipDo);
	
	AdmissionDetail ad = populateAdmissionDetailfromInpatientEpisode(ipDo,episVo, null);
	factory.save(ad);
	
	domPatient.setWard(ipDo.getPasEvent().getLocation());
	// WDEV-17867 - Set Current Responsible Clinician to Patient record
	domPatient.setCurrentResponsibleConsultant(ipDo.getPasEvent().getConsultant());
	factory.save(domPatient);
	
	return InpatientEpisodeVoAssembler.create(ipDo);
}
 
Example 29
Project: openMAXIMS   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 4 votes vote down vote up
public STHKPendingElectiveAdmissionListVo getCurrentPendingRecord(PendingElectiveAdmissionRefVo electiveRefVo) 
{
	DomainFactory factory = getDomainFactory();
	return STHKPendingElectiveAdmissionListVoAssembler.create((PendingElectiveAdmission) factory.getDomainObject(PendingElectiveAdmission.class, electiveRefVo.getID_PendingElectiveAdmission()));
}
 
Example 30
Project: openMAXIMS   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}
 
Example 31
Project: openMAXIMS   File: ADTImpl.java   Source Code and License 4 votes vote down vote up
public InpatientEpisodeVo readmitPatient(PatientShort patVo, InpatientEpisodeVo episVo) throws StaleObjectException 
{
	if (!patVo.isValidated())
	{
		throw new CodingRuntimeException("Patient VO has not been validated!");
	}
	if (!episVo.isValidated())
	{
		throw new CodingRuntimeException("Episode VO has not been validated!");
	}
	if(patVo.getID_Patient() == null)
	{
		throw new CodingRuntimeException("Internal Patient ID must be valued.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	ims.core.patient.domain.objects.Patient domPatient =  (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patVo.getID_Patient().intValue());

	PASEvent domTCIPas=null;
	if (episVo!=null&&episVo.getPreAdmitNumber()!=null)
		domTCIPas = PASEvent.getPASEventFrompasevent_unq1(factory, domPatient, episVo.getPreAdmitNumber());
	
	PendingElectiveAdmission domPEA =  getDomPendingElectiveAdmission(domPatient,domTCIPas);
	if(null!=domPEA)
	{
		domPEA.setElectiveAdmissionStatus(getDomLookup(ElectiveAdmissionStatus.ADMITTED));
		factory.save(domPEA);
	}
	
	InpatientEpisode ipDo = InpatientEpisodeVoAssembler.extractInpatientEpisode(factory, episVo);
	if (ipDo!=null)
	{
		WardStay ws = new WardStay();
		ws.setTransferDateTime(ipDo.getAdmissionDateTime());
		if (ipDo.getPasEvent()!=null)
			ws.setWard(ipDo.getPasEvent().getLocation());
		ws.setWardType(ipDo.getWardType());
	
		if(ipDo.getPasEvent()!=null&&ipDo.getPasEvent().getConsultant()!=null)
		{
			ConsultantStay cs = new ConsultantStay();
			cs.setConsultant(ipDo.getPasEvent().getConsultant());
			cs.setTransferDateTime(ipDo.getAdmissionDateTime());
			ipDo.getConsultantStays().add(cs);
		}
		
		ipDo.getWardStays().add(ws);
	}
	factory.save(ipDo);
	
	AdmissionDetail ad = populateAdmissionDetailfromInpatientEpisode(ipDo,episVo, null);
	factory.save(ad);
	
	domPatient.setWard(ipDo.getPasEvent().getLocation());
	// WDEV-17867 - Set Current Responsible Clinician to Patient record
	domPatient.setCurrentResponsibleConsultant(ipDo.getPasEvent().getConsultant());
	factory.save(domPatient);
	
	return InpatientEpisodeVoAssembler.create(ipDo);
}
 
Example 32
Project: openMAXIMS   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 4 votes vote down vote up
public STHKPendingElectiveAdmissionListVo getCurrentPendingRecord(PendingElectiveAdmissionRefVo electiveRefVo) 
{
	DomainFactory factory = getDomainFactory();
	return STHKPendingElectiveAdmissionListVoAssembler.create((PendingElectiveAdmission) factory.getDomainObject(PendingElectiveAdmission.class, electiveRefVo.getID_PendingElectiveAdmission()));
}
 
Example 33
Project: openmaxims-linux   File: AssignWardImpl.java   Source Code and License 4 votes vote down vote up
/**
 * update booklist entry on PAS and then save locally if successful
 */
public void savePendingElectiveAdmission(PendingElectiveAdmissionAdmitVo pendingElective) throws DomainInterfaceException, StaleObjectException
{
	if (pendingElective == null)
		throw new CodingRuntimeException("pendingElective is null in method savePendingElectiveAdmission");
	if (!pendingElective.isValidated())
		throw new CodingRuntimeException("pendingElective has not been validated in method savePendingElectiveAdmission");

	DomainFactory factory = getDomainFactory();
	PendingElectiveAdmission doPendingElective = PendingElectiveAdmissionAdmitVoAssembler.extractPendingElectiveAdmission(factory, pendingElective);

	BooklistRecord dtoBooklist = null;
	ims.dto.client.Booklist booklistRec = null;
	try
	{
		booklistRec = (ims.dto.client.Booklist) getDTOInstance(ims.dto.client.Booklist.class);	
	}
	catch(ResultException e)
	{
		throw new DomainInterfaceException("Failed to Connect to PAS - Please check Configuration", e);
	}
	
	booklistRec.Filter.clear();
	if(pendingElective.getPasEventIsNotNull() && pendingElective.getPasEvent().getPatientIsNotNull())
	{
		ims.core.vo.PatientId intfId = pendingElective.getPasEvent().getPatient().getHospnum();
		Result result = null;
		if (intfId != null)
			booklistRec.Filter.Hospnum = intfId.getValue();
		else
			throw new DomainRuntimeException("No valid Interface Patient Identifier supplied.");
		
		if(doPendingElective.getTCITime() != null)
			booklistRec.Filter.Time = DTOHelper.convertToDtoTime(doPendingElective.getTCITime());
		else
			throw new CodingRuntimeException("No valid TCI Time supplied.");
		
		if(doPendingElective.getTCIDate() != null)
			booklistRec.Filter.Date = DTOHelper.convertToDtoDate(doPendingElective.getTCIDate());
		else
			throw new CodingRuntimeException("No valid TCI Date supplied.");
		
		result = booklistRec.get();
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to get from Pas failed " + result.getMessage());
		
		dtoBooklist = booklistRec.DataCollection.get(0);
		if(doPendingElective.getAllocatedWard() == null)
			throw new CodingRuntimeException("Allocated Ward not set");
			
		dtoBooklist.Rescode = doPendingElective.getAllocatedWard().getExtCode(TaxonomyType.PAS.getID());
		dtoBooklist.Webadt = "Y";
		
		result = booklistRec.update();
		
		if(result != null && result.getId() < 0)
			throw new DomainInterfaceException("Attempt to save to Pas failed " + result.getMessage());
	}
	
	factory.save(doPendingElective);
}
 
Example 34
Project: openmaxims-linux   File: ADTImpl.java   Source Code and License 4 votes vote down vote up
public InpatientEpisodeVo readmitPatient(PatientShort patVo, InpatientEpisodeVo episVo) throws StaleObjectException 
{
	if (!patVo.isValidated())
	{
		throw new CodingRuntimeException("Patient VO has not been validated!");
	}
	if (!episVo.isValidated())
	{
		throw new CodingRuntimeException("Episode VO has not been validated!");
	}
	if(patVo.getID_Patient() == null)
	{
		throw new CodingRuntimeException("Internal Patient ID must be valued.");
	}
	
	DomainFactory factory = getDomainFactory();
	
	ims.core.patient.domain.objects.Patient domPatient =  (ims.core.patient.domain.objects.Patient)factory.getDomainObject(ims.core.patient.domain.objects.Patient.class, patVo.getID_Patient().intValue());

	PASEvent domTCIPas=null;
	if (episVo!=null&&episVo.getPreAdmitNumber()!=null)
		domTCIPas = PASEvent.getPASEventFrompasevent_unq1(factory, domPatient, episVo.getPreAdmitNumber());
	
	PendingElectiveAdmission domPEA =  getDomPendingElectiveAdmission(domPatient,domTCIPas);
	if(null!=domPEA)
	{
		domPEA.setElectiveAdmissionStatus(getDomLookup(ElectiveAdmissionStatus.ADMITTED));
		factory.save(domPEA);
	}
	
	InpatientEpisode ipDo = InpatientEpisodeVoAssembler.extractInpatientEpisode(factory, episVo);
	if (ipDo!=null)
	{
		WardStay ws = new WardStay();
		ws.setTransferDateTime(ipDo.getAdmissionDateTime());
		if (ipDo.getPasEvent()!=null)
			ws.setWard(ipDo.getPasEvent().getLocation());
		ws.setWardType(ipDo.getWardType());
	
		if(ipDo.getPasEvent()!=null&&ipDo.getPasEvent().getConsultant()!=null)
		{
			ConsultantStay cs = new ConsultantStay();
			cs.setConsultant(ipDo.getPasEvent().getConsultant());
			cs.setTransferDateTime(ipDo.getAdmissionDateTime());
			ipDo.getConsultantStays().add(cs);
		}
		
		ipDo.getWardStays().add(ws);
	}
	factory.save(ipDo);
	
	AdmissionDetail ad = populateAdmissionDetailfromInpatientEpisode(ipDo,episVo, null);
	factory.save(ad);
	
	domPatient.setWard(ipDo.getPasEvent().getLocation());
	// WDEV-17867 - Set Current Responsible Clinician to Patient record
	domPatient.setCurrentResponsibleConsultant(ipDo.getPasEvent().getConsultant());
	factory.save(domPatient);
	
	return InpatientEpisodeVoAssembler.create(ipDo);
}
 
Example 35
Project: openmaxims-linux   File: STHKPendingElectiveAdmissionsListComponentImpl.java   Source Code and License 4 votes vote down vote up
public STHKPendingElectiveAdmissionListVo getCurrentPendingRecord(PendingElectiveAdmissionRefVo electiveRefVo) 
{
	DomainFactory factory = getDomainFactory();
	return STHKPendingElectiveAdmissionListVoAssembler.create((PendingElectiveAdmission) factory.getDomainObject(PendingElectiveAdmission.class, electiveRefVo.getID_PendingElectiveAdmission()));
}