Java 类ims.clinical.vo.domain.PatientProcedureChecklistVoAssembler 实例源码

项目:AvoinApotti    文件:PatientProcedureChecklistImpl.java   
/**
* Save a ProcedureVo
*/
public PatientProcedureChecklistVo savePatienProcedureChecklist(PatientProcedureChecklistVo procedureChecklist) throws StaleObjectException 
{
    if (!procedureChecklist.isValidated())
        throw new DomainRuntimeException("Procedure Checklist has not been validated");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    if(procedureChecklist.getID_PatientProcedureChecklist() == null)
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ")");
    else
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ") and p.id <> " +  procedureChecklist.getID_PatientProcedureChecklist());

    List list = (factory.find(hql.toString()));

    if(list.size() > 0)
        throw new DomainRuntimeException("A record exists for this clinical contact, the screen will be refreshed");

    PatientProcedureChecklist domChecklist = PatientProcedureChecklistVoAssembler.extractPatientProcedureChecklist(factory, procedureChecklist);
    factory.save(domChecklist);      
    return PatientProcedureChecklistVoAssembler.create(domChecklist);
}
项目:openMAXIMS    文件:PatientProcedureChecklistImpl.java   
/**
* Save a ProcedureVo
*/
public PatientProcedureChecklistVo savePatienProcedureChecklist(PatientProcedureChecklistVo procedureChecklist) throws StaleObjectException 
{
    if (!procedureChecklist.isValidated())
        throw new DomainRuntimeException("Procedure Checklist has not been validated");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    if(procedureChecklist.getID_PatientProcedureChecklist() == null)
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ")");
    else
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ") and p.id <> " +  procedureChecklist.getID_PatientProcedureChecklist());

    List list = (factory.find(hql.toString()));

    if(list.size() > 0)
        throw new DomainRuntimeException("A record exists for this clinical contact, the screen will be refreshed");

    PatientProcedureChecklist domChecklist = PatientProcedureChecklistVoAssembler.extractPatientProcedureChecklist(factory, procedureChecklist);
    factory.save(domChecklist);      
    return PatientProcedureChecklistVoAssembler.create(domChecklist);
}
项目:openMAXIMS    文件:PatientProcedureChecklistImpl.java   
/**
* Save a ProcedureVo
*/
public PatientProcedureChecklistVo savePatienProcedureChecklist(PatientProcedureChecklistVo procedureChecklist) throws StaleObjectException 
{
    if (!procedureChecklist.isValidated())
        throw new DomainRuntimeException("Procedure Checklist has not been validated");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    if(procedureChecklist.getID_PatientProcedureChecklist() == null)
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ")");
    else
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ") and p.id <> " +  procedureChecklist.getID_PatientProcedureChecklist());

    List list = (factory.find(hql.toString()));

    if(list.size() > 0)
        throw new DomainRuntimeException("A record exists for this clinical contact, the screen will be refreshed");

    PatientProcedureChecklist domChecklist = PatientProcedureChecklistVoAssembler.extractPatientProcedureChecklist(factory, procedureChecklist);
    factory.save(domChecklist);      
    return PatientProcedureChecklistVoAssembler.create(domChecklist);
}
项目:openmaxims-linux    文件:PatientProcedureChecklistImpl.java   
/**
* Save a ProcedureVo
*/
public PatientProcedureChecklistVo savePatienProcedureChecklist(PatientProcedureChecklistVo procedureChecklist) throws StaleObjectException 
{
    if (!procedureChecklist.isValidated())
        throw new DomainRuntimeException("Procedure Checklist has not been validated");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    if(procedureChecklist.getID_PatientProcedureChecklist() == null)
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ")");
    else
        hql.append(" where (p.clinicalContact.id = " + procedureChecklist.getClinicalContact().getID_ClinicalContact() + ") and p.id <> " +  procedureChecklist.getID_PatientProcedureChecklist());

    List list = (factory.find(hql.toString()));

    if(list.size() > 0)
        throw new DomainRuntimeException("A record exists for this clinical contact, the screen will be refreshed");

    PatientProcedureChecklist domChecklist = PatientProcedureChecklistVoAssembler.extractPatientProcedureChecklist(factory, procedureChecklist);
    factory.save(domChecklist);      
    return PatientProcedureChecklistVoAssembler.create(domChecklist);
}
项目:AvoinApotti    文件:PatientProcedureChecklistImpl.java   
public PatientProcedureChecklistVo getPatientProcedureChecklistVo(ClinicalContactRefVo clinicalContact) {
    if(clinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + clinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist==null || collPatientProcedureChecklist.size()==0)
        return null;

    return collPatientProcedureChecklist.get(0);
}
项目:AvoinApotti    文件:PlannedProcedureImpl.java   
public Boolean checkForProcedureChecklist(ClinicalContactRefVo refClinicalContact) {
    if(refClinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + refClinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist.size()==0)
        return Boolean.FALSE;

    return Boolean.TRUE;
}
项目:openMAXIMS    文件:PatientProcedureChecklistImpl.java   
public PatientProcedureChecklistVo getPatientProcedureChecklistVo(ClinicalContactRefVo clinicalContact) {
    if(clinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + clinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist==null || collPatientProcedureChecklist.size()==0)
        return null;

    return collPatientProcedureChecklist.get(0);
}
项目:openMAXIMS    文件:PlannedProcedureImpl.java   
public Boolean checkForProcedureChecklist(ClinicalContactRefVo refClinicalContact) {
    if(refClinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + refClinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist.size()==0)
        return Boolean.FALSE;

    return Boolean.TRUE;
}
项目:openMAXIMS    文件:PatientProcedureChecklistImpl.java   
public PatientProcedureChecklistVo getPatientProcedureChecklistVo(ClinicalContactRefVo clinicalContact) {
    if(clinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + clinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist==null || collPatientProcedureChecklist.size()==0)
        return null;

    return collPatientProcedureChecklist.get(0);
}
项目:openMAXIMS    文件:PlannedProcedureImpl.java   
public Boolean checkForProcedureChecklist(ClinicalContactRefVo refClinicalContact) {
    if(refClinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + refClinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist.size()==0)
        return Boolean.FALSE;

    return Boolean.TRUE;
}
项目:openmaxims-linux    文件:PatientProcedureChecklistImpl.java   
public PatientProcedureChecklistVo getPatientProcedureChecklistVo(ClinicalContactRefVo clinicalContact) {
    if(clinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + clinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist==null || collPatientProcedureChecklist.size()==0)
        return null;

    return collPatientProcedureChecklist.get(0);
}
项目:openmaxims-linux    文件:PlannedProcedureImpl.java   
public Boolean checkForProcedureChecklist(ClinicalContactRefVo refClinicalContact) {
    if(refClinicalContact == null)
        throw new DomainRuntimeException("Invalid Search criteria. ClinicalContact must be supplied.");

    DomainFactory factory = getDomainFactory();

    StringBuffer hql = new StringBuffer("from PatientProcedureChecklist p ");
    hql.append(" where (p.clinicalContact.id = " + refClinicalContact.getID_ClinicalContact() + ")");
    PatientProcedureChecklistVoCollection collPatientProcedureChecklist = PatientProcedureChecklistVoAssembler.createPatientProcedureChecklistVoCollectionFromPatientProcedureChecklist((factory.find(hql.toString())));

    if(collPatientProcedureChecklist.size()==0)
        return Boolean.FALSE;

    return Boolean.TRUE;
}