Java 类ims.core.vo.domain.DeathDetailsVoAssembler 实例源码

项目:AvoinApotti    文件:DemographicsImpl.java   
public DeathDetailsVo saveDeathDetails(DeathDetailsVo deathDetails) throws StaleObjectException 
{
    // Ensure the value object has been validated
    if (!deathDetails.isValidated())
        throw new DomainRuntimeException("Death details has not been validated");

    DomainFactory factory = getDomainFactory();
    DeathDetails doDD = DeathDetailsVoAssembler.extractDeathDetails(factory, deathDetails);

    if (deathDetails.getIsRIE() != null)
        doDD.setIsRIE(deathDetails.getIsRIE());

    factory.save(doDD);

    return DeathDetailsVoAssembler.create(doDD);
}
项目:AvoinApotti    文件:DemographicsImpl.java   
public DeathDetailsVo getDeathDetails(PatientShort value)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd"); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" where dd.patient.id = :pId");

    markers.add("pId");
    values.add(value.getID_Patient());

    hql.append(" and dd.isRIE is null");


    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;

}
项目:AvoinApotti    文件:DeathDetailsImpl.java   
/**
* getDeathDetails
*/
public ims.core.vo.DeathDetailsVo getDeathDetails(ims.core.patient.vo.PatientRefVo patientRefVo)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" dd.patient.id = :pId");
    markers.add("pId");
    values.add(patientRefVo.getID_Patient());

    hql.append(" and dd.isRIE is null");

    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:DemographicsImpl.java   
public DeathDetailsVo saveDeathDetails(DeathDetailsVo deathDetails) throws StaleObjectException 
{
    // Ensure the value object has been validated
    if (!deathDetails.isValidated())
        throw new DomainRuntimeException("Death details has not been validated");

    DomainFactory factory = getDomainFactory();
    DeathDetails doDD = DeathDetailsVoAssembler.extractDeathDetails(factory, deathDetails);

    if (deathDetails.getIsRIE() != null)
        doDD.setIsRIE(deathDetails.getIsRIE());

    factory.save(doDD);

    return DeathDetailsVoAssembler.create(doDD);
}
项目:openMAXIMS    文件:DemographicsImpl.java   
public DeathDetailsVo getDeathDetails(PatientShort value)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd"); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" where dd.patient.id = :pId");

    markers.add("pId");
    values.add(value.getID_Patient());

    hql.append(" and dd.isRIE is null");


    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;

}
项目:openMAXIMS    文件:PDSDemographicsImpl.java   
public DeathDetailsVo saveDeathDetails(DeathDetailsVo deathDetails) throws StaleObjectException 
{
    // Ensure the value object has been validated
    if (!deathDetails.isValidated())
        throw new DomainRuntimeException("Death details has not been validated");

    DomainFactory factory = getDomainFactory();
    DeathDetails doDD = DeathDetailsVoAssembler.extractDeathDetails(factory, deathDetails);

    if (deathDetails.getIsRIE() != null)
        doDD.setIsRIE(deathDetails.getIsRIE());

    factory.save(doDD);

    return DeathDetailsVoAssembler.create(doDD);
}
项目:openMAXIMS    文件:PDSDemographicsImpl.java   
public DeathDetailsVo getDeathDetails(PatientRefVo value)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd"); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" where dd.patient.id = :pId");

    markers.add("pId");
    values.add(value.getID_Patient());

    hql.append(" and dd.isRIE is null");


    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;

}
项目:openMAXIMS    文件:DeathDetailsImpl.java   
/**
* getDeathDetails
*/
public ims.core.vo.DeathDetailsVo getDeathDetails(ims.core.patient.vo.PatientRefVo patientRefVo)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" dd.patient.id = :pId");
    markers.add("pId");
    values.add(patientRefVo.getID_Patient());

    hql.append(" and dd.isRIE is null");

    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:DemographicsImpl.java   
public DeathDetailsVo saveDeathDetails(DeathDetailsVo deathDetails) throws StaleObjectException 
{
    // Ensure the value object has been validated
    if (!deathDetails.isValidated())
        throw new DomainRuntimeException("Death details has not been validated");

    DomainFactory factory = getDomainFactory();
    DeathDetails doDD = DeathDetailsVoAssembler.extractDeathDetails(factory, deathDetails);

    if (deathDetails.getIsRIE() != null)
        doDD.setIsRIE(deathDetails.getIsRIE());

    factory.save(doDD);

    return DeathDetailsVoAssembler.create(doDD);
}
项目:openMAXIMS    文件:DemographicsImpl.java   
public DeathDetailsVo getDeathDetails(PatientShort value)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd"); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" where dd.patient.id = :pId");

    markers.add("pId");
    values.add(value.getID_Patient());

    hql.append(" and dd.isRIE is null");


    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;

}
项目:openMAXIMS    文件:DeathDetailsImpl.java   
/**
* getDeathDetails
*/
public ims.core.vo.DeathDetailsVo getDeathDetails(ims.core.patient.vo.PatientRefVo patientRefVo)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" dd.patient.id = :pId");
    markers.add("pId");
    values.add(patientRefVo.getID_Patient());

    hql.append(" and dd.isRIE is null");

    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openmaxims-linux    文件:DemographicsImpl.java   
public DeathDetailsVo saveDeathDetails(DeathDetailsVo deathDetails) throws StaleObjectException 
{
    // Ensure the value object has been validated
    if (!deathDetails.isValidated())
        throw new DomainRuntimeException("Death details has not been validated");

    DomainFactory factory = getDomainFactory();
    DeathDetails doDD = DeathDetailsVoAssembler.extractDeathDetails(factory, deathDetails);

    if (deathDetails.getIsRIE() != null)
        doDD.setIsRIE(deathDetails.getIsRIE());

    factory.save(doDD);

    return DeathDetailsVoAssembler.create(doDD);
}
项目:openmaxims-linux    文件:DemographicsImpl.java   
public DeathDetailsVo getDeathDetails(PatientShort value)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd"); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" where dd.patient.id = :pId");

    markers.add("pId");
    values.add(value.getID_Patient());

    hql.append(" and dd.isRIE is null");


    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;

}
项目:openmaxims-linux    文件:DeathDetailsImpl.java   
/**
* getDeathDetails
*/
public ims.core.vo.DeathDetailsVo getDeathDetails(ims.core.patient.vo.PatientRefVo patientRefVo)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer(" from DeathDetails dd where "); 

    ArrayList markers = new ArrayList();
    ArrayList values = new ArrayList();

    hql.append(" dd.patient.id = :pId");
    markers.add("pId");
    values.add(patientRefVo.getID_Patient());

    hql.append(" and dd.isRIE is null");

    List listNotes = factory.find(hql.toString(), markers,values);
    if(listNotes != null && listNotes.size() > 0)
    { 
        DeathDetailsVoCollection voColl = DeathDetailsVoAssembler.createDeathDetailsVoCollectionFromDeathDetails(listNotes);
        if(voColl != null && voColl.size() > 0)
            return voColl.get(0);
    }
    return null;
}
项目:openMAXIMS    文件:DeathDetailsImpl.java   
@Override
public Patient unDeceasePatient(Patient patient, DeathDetailsVo deathDetails) throws DomainInterfaceException, StaleObjectException
{
    DomainFactory factory = getDomainFactory();

    ims.core.patient.domain.objects.Patient domPatient = PatientAssembler.extractPatient(factory, patient);
    factory.save(domPatient);

    if(deathDetails != null)
    {
        deathDetails.setCancerRelatedDeath(null);
        deathDetails.setDeathCauseEstablished(null);
        deathDetails.setDeathCodeDiscrepency(null);
        deathDetails.setDeathConditions(null);
        deathDetails.setDeathPlaceofDeath(null);
        deathDetails.setPostMortem(null);
        deathDetails.setReferredToCorroner(null);

        DeathDetails domDeathDetails = DeathDetailsVoAssembler.extractDeathDetails(factory, deathDetails);
        factory.save(domDeathDetails);
    }

    Patient patientInContext = PatientAssembler.create(domPatient); 

    PdsQuery q = new PdsQuery(this);
    q.setNhsNumber(patientInContext.getNhsn() != null ? patientInContext.getNhsn().getValue() : "");
    q.setPatientInContext(patientInContext);

    try
    {
        PDSBackOfficeItemVo backOfficeItem = q.buildBackOfficeItemAndNotification(PDSBackOfficeType.DEATH, "Undecease patient", PDSBackOfficeWorkPriority.P1);
        PDSBackOfficeItem domBackOfficeItem = PDSBackOfficeItemVoAssembler.extractPDSBackOfficeItem(factory, backOfficeItem);

        factory.save(domBackOfficeItem);
    }
    catch (PdsException e)
    {
        e.printStackTrace();

        throw new DomainInterfaceException(e);
    }

    return patientInContext;
}