Java 类ims.nursing.vo.AssessmentComponent 实例源码

项目:AvoinApotti    文件:NurAssessmentComponentImpl.java   
private boolean checkCompleteAssessment(AdmissionAssessment assmnt) 
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    int numberOfCompleteAssessment = 0;
    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;

    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();

        if(comp.isIsComplete() != null && comp.isIsComplete().booleanValue() == true)
        {
            numberOfCompleteAssessment++;

            if(numberOfCompleteAssessment >= ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())
                return true;
        }
    }

    return false;
}
项目:AvoinApotti    文件:NurAssessmentComponentImpl.java   
/**
 * Checks for incomplete assessment components for this assessment
 * if only one found - the current one, we want to update the
 * assessment status to complete
 * @param assmnt
 * @return true to update the assessment, false otherwise
 */
public boolean completeAssessment(AdmissionAssessment assmnt)
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;
    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();
        if (comp.isIsComplete() == null || comp.isIsComplete().booleanValue() == false) 
            return false;
    }
    return true;
}
项目:AvoinApotti    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponentByCareContext(CareContextShortVo voCareContext, AssessmentComponentType assessmentComponentType)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select asmntComp " +
            " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
            " where asmntComp.assessment.careContext.episodeOfCare.id = :episodeID" +
            " and asmntComp.componentType = :compType"+ 
            " and asmntComp.isRIE is null"+
            " order by asmntComp.id desc";

    java.util.List components = factory.find(hql, new String[]{"episodeID", "compType"}, new Object[]{voCareContext.getEpisodeOfCare().getID_EpisodeOfCare(), getDomLookup(assessmentComponentType)});
    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }

    return null;    
}
项目:AvoinApotti    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getAssessComponent(Integer admissionAssessId, AssessmentComponentType comptype) 
{
    if(admissionAssessId == null || comptype == null)
        return null;

    DomainFactory factory = getDomainFactory();

    String hql = "select a1_1 from AssessmentComponent as a1_1 left join a1_1.assessment as a2_1 where (a2_1.id = :admassesID and a1_1.componentType = :compType) and a1_1.isRIE is null";

    java.util.List components = factory.find(hql, new String[]{"admassesID", "compType"}, new Object[]{admissionAssessId,getDomLookup(comptype)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        return (copyComp);              
    }

    return null;    

}
项目:AvoinApotti    文件:PatientMovementImpl.java   
/**
 * saves Patient Handling
 */
public AssessmentHeaderInfo savePatientHandling(PatientHandling patientHandling, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the value object has been validated
    if (!patientHandling.isValidated())
        throw new DomainRuntimeException("Patient Handling has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandlingScreening domHandle = PatientHandlingAssembler.extractPatientMovementHandlingScreening(factory, patientHandling);

    factory.save(domHandle);

    /*  if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientHandling(PatientHandlingAssembler.create(domHandle));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");

            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:AvoinApotti    文件:PatientMovementImpl.java   
/**
 * saves Patient Movement
 */
public AssessmentHeaderInfo savePatientMovement(PatientMovement patientMovement, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the Patient Movement has been validated
    if (!patientMovement.isValidated())
        throw new DomainRuntimeException("Patient Movement has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandling domMovement = PatientMovementAssembler.extractPatientMovementHandling(factory, patientMovement);

    factory.save(domMovement);

        /*if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientMovement(PatientMovementAssembler.create(domMovement));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");
            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:AvoinApotti    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, AssessmentComponentType componentTypeVo) 
{
    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }
    return null;
}
项目:AvoinApotti    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, CareContextRefVo careContextRefVo, AssessmentComponentType componentTypeVo) 
{

    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    } 
    return null;            
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
private boolean checkCompleteAssessment(AdmissionAssessment assmnt) 
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    int numberOfCompleteAssessment = 0;
    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;

    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();

        if(comp.isIsComplete() != null && comp.isIsComplete().booleanValue() == true)
        {
            numberOfCompleteAssessment++;

            if(numberOfCompleteAssessment >= ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())
                return true;
        }
    }

    return false;
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
/**
 * Checks for incomplete assessment components for this assessment
 * if only one found - the current one, we want to update the
 * assessment status to complete
 * @param assmnt
 * @return true to update the assessment, false otherwise
 */
public boolean completeAssessment(AdmissionAssessment assmnt)
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;
    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();
        if (comp.isIsComplete() == null || comp.isIsComplete().booleanValue() == false) 
            return false;
    }
    return true;
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponentByCareContext(CareContextShortVo voCareContext, AssessmentComponentType assessmentComponentType)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select asmntComp " +
            " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
            " where asmntComp.assessment.careContext.episodeOfCare.id = :episodeID" +
            " and asmntComp.componentType = :compType"+ 
            " and asmntComp.isRIE is null"+
            " order by asmntComp.id desc";

    java.util.List components = factory.find(hql, new String[]{"episodeID", "compType"}, new Object[]{voCareContext.getEpisodeOfCare().getID_EpisodeOfCare(), getDomLookup(assessmentComponentType)});
    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }

    return null;    
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getAssessComponent(Integer admissionAssessId, AssessmentComponentType comptype) 
{
    if(admissionAssessId == null || comptype == null)
        return null;

    DomainFactory factory = getDomainFactory();

    String hql = "select a1_1 from AssessmentComponent as a1_1 left join a1_1.assessment as a2_1 where (a2_1.id = :admassesID and a1_1.componentType = :compType) and a1_1.isRIE is null";

    java.util.List components = factory.find(hql, new String[]{"admassesID", "compType"}, new Object[]{admissionAssessId,getDomLookup(comptype)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        return (copyComp);              
    }

    return null;    

}
项目:openMAXIMS    文件:PatientMovementImpl.java   
/**
 * saves Patient Handling
 */
public AssessmentHeaderInfo savePatientHandling(PatientHandling patientHandling, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the value object has been validated
    if (!patientHandling.isValidated())
        throw new DomainRuntimeException("Patient Handling has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandlingScreening domHandle = PatientHandlingAssembler.extractPatientMovementHandlingScreening(factory, patientHandling);

    factory.save(domHandle);

    /*  if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientHandling(PatientHandlingAssembler.create(domHandle));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");

            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:openMAXIMS    文件:PatientMovementImpl.java   
/**
 * saves Patient Movement
 */
public AssessmentHeaderInfo savePatientMovement(PatientMovement patientMovement, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the Patient Movement has been validated
    if (!patientMovement.isValidated())
        throw new DomainRuntimeException("Patient Movement has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandling domMovement = PatientMovementAssembler.extractPatientMovementHandling(factory, patientMovement);

    factory.save(domMovement);

        /*if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientMovement(PatientMovementAssembler.create(domMovement));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");
            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:openMAXIMS    文件:InfectionControlRepeatableAssessmentImpl.java   
public AssessmentComponent getInfectionComponent(InfectionControlRepeatableAssessmentVo value)
{
    DomainFactory factory = getDomainFactory();

    String hql =" from InfectionControlComponent as infectionControlComponent " +
            "where infectionControlComponent.infectionControlAssessment.id = "+value.getBoId();

    List comps = factory.find(hql);

    AssessmentComponentCollection result = AssessmentComponentAssembler.createAssessmentComponentCollectionFromAssessmentComponent(comps);

    if(result.size() >0)
        return result.get(0);
    else
        return null;
}
项目:openMAXIMS    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, AssessmentComponentType componentTypeVo) 
{
    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }
    return null;
}
项目:openMAXIMS    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, CareContextRefVo careContextRefVo, AssessmentComponentType componentTypeVo) 
{

    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    } 
    return null;            
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
private boolean checkCompleteAssessment(AdmissionAssessment assmnt) 
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    int numberOfCompleteAssessment = 0;
    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;

    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();

        if(comp.isIsComplete() != null && comp.isIsComplete().booleanValue() == true)
        {
            numberOfCompleteAssessment++;

            if(numberOfCompleteAssessment >= ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())
                return true;
        }
    }

    return false;
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
/**
 * Checks for incomplete assessment components for this assessment
 * if only one found - the current one, we want to update the
 * assessment status to complete
 * @param assmnt
 * @return true to update the assessment, false otherwise
 */
public boolean completeAssessment(AdmissionAssessment assmnt)
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;
    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();
        if (comp.isIsComplete() == null || comp.isIsComplete().booleanValue() == false) 
            return false;
    }
    return true;
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponentByCareContext(CareContextShortVo voCareContext, AssessmentComponentType assessmentComponentType)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select asmntComp " +
            " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
            " where asmntComp.assessment.careContext.episodeOfCare.id = :episodeID" +
            " and asmntComp.componentType = :compType"+ 
            " and asmntComp.isRIE is null"+
            " order by asmntComp.id desc";

    java.util.List components = factory.find(hql, new String[]{"episodeID", "compType"}, new Object[]{voCareContext.getEpisodeOfCare().getID_EpisodeOfCare(), getDomLookup(assessmentComponentType)});
    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }

    return null;    
}
项目:openMAXIMS    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getAssessComponent(Integer admissionAssessId, AssessmentComponentType comptype) 
{
    if(admissionAssessId == null || comptype == null)
        return null;

    DomainFactory factory = getDomainFactory();

    String hql = "select a1_1 from AssessmentComponent as a1_1 left join a1_1.assessment as a2_1 where (a2_1.id = :admassesID and a1_1.componentType = :compType) and a1_1.isRIE is null";

    java.util.List components = factory.find(hql, new String[]{"admassesID", "compType"}, new Object[]{admissionAssessId,getDomLookup(comptype)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        return (copyComp);              
    }

    return null;    

}
项目:openMAXIMS    文件:PatientMovementImpl.java   
/**
 * saves Patient Handling
 */
public AssessmentHeaderInfo savePatientHandling(PatientHandling patientHandling, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the value object has been validated
    if (!patientHandling.isValidated())
        throw new DomainRuntimeException("Patient Handling has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandlingScreening domHandle = PatientHandlingAssembler.extractPatientMovementHandlingScreening(factory, patientHandling);

    factory.save(domHandle);

    /*  if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientHandling(PatientHandlingAssembler.create(domHandle));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");

            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:openMAXIMS    文件:PatientMovementImpl.java   
/**
 * saves Patient Movement
 */
public AssessmentHeaderInfo savePatientMovement(PatientMovement patientMovement, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the Patient Movement has been validated
    if (!patientMovement.isValidated())
        throw new DomainRuntimeException("Patient Movement has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandling domMovement = PatientMovementAssembler.extractPatientMovementHandling(factory, patientMovement);

    factory.save(domMovement);

        /*if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientMovement(PatientMovementAssembler.create(domMovement));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");
            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:openMAXIMS    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, AssessmentComponentType componentTypeVo) 
{
    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }
    return null;
}
项目:openMAXIMS    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, CareContextRefVo careContextRefVo, AssessmentComponentType componentTypeVo) 
{

    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    } 
    return null;            
}
项目:openmaxims-linux    文件:NurAssessmentComponentImpl.java   
private boolean checkCompleteAssessment(AdmissionAssessment assmnt) 
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    int numberOfCompleteAssessment = 0;
    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;

    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();

        if(comp.isIsComplete() != null && comp.isIsComplete().booleanValue() == true)
        {
            numberOfCompleteAssessment++;

            if(numberOfCompleteAssessment >= ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())
                return true;
        }
    }

    return false;
}
项目:openmaxims-linux    文件:NurAssessmentComponentImpl.java   
/**
 * Checks for incomplete assessment components for this assessment
 * if only one found - the current one, we want to update the
 * assessment status to complete
 * @param assmnt
 * @return true to update the assessment, false otherwise
 */
public boolean completeAssessment(AdmissionAssessment assmnt)
{
    Set comps = assmnt.getComponents();
    if (comps.size() < (ConfigFlag.DOM.ASSESSMENT_COMPONENT_NO.getValue())) 
        return false;

    Iterator iter = comps.iterator();
    ims.nursing.assessment.domain.objects.AssessmentComponent comp;
    while (iter.hasNext())
    {
        comp = (ims.nursing.assessment.domain.objects.AssessmentComponent)iter.next();
        if (comp.isIsComplete() == null || comp.isIsComplete().booleanValue() == false) 
            return false;
    }
    return true;
}
项目:openmaxims-linux    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponentByCareContext(CareContextShortVo voCareContext, AssessmentComponentType assessmentComponentType)
{
    DomainFactory factory = getDomainFactory();

    String hql = "select asmntComp " +
            " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
            " where asmntComp.assessment.careContext.episodeOfCare.id = :episodeID" +
            " and asmntComp.componentType = :compType"+ 
            " and asmntComp.isRIE is null"+
            " order by asmntComp.id desc";

    java.util.List components = factory.find(hql, new String[]{"episodeID", "compType"}, new Object[]{voCareContext.getEpisodeOfCare().getID_EpisodeOfCare(), getDomLookup(assessmentComponentType)});
    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }

    return null;    
}
项目:openmaxims-linux    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getAssessComponent(Integer admissionAssessId, AssessmentComponentType comptype) 
{
    if(admissionAssessId == null || comptype == null)
        return null;

    DomainFactory factory = getDomainFactory();

    String hql = "select a1_1 from AssessmentComponent as a1_1 left join a1_1.assessment as a2_1 where (a2_1.id = :admassesID and a1_1.componentType = :compType) and a1_1.isRIE is null";

    java.util.List components = factory.find(hql, new String[]{"admassesID", "compType"}, new Object[]{admissionAssessId,getDomLookup(comptype)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        return (copyComp);              
    }

    return null;    

}
项目:openmaxims-linux    文件:PatientMovementImpl.java   
/**
 * saves Patient Handling
 */
public AssessmentHeaderInfo savePatientHandling(PatientHandling patientHandling, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the value object has been validated
    if (!patientHandling.isValidated())
        throw new DomainRuntimeException("Patient Handling has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandlingScreening domHandle = PatientHandlingAssembler.extractPatientMovementHandlingScreening(factory, patientHandling);

    factory.save(domHandle);

    /*  if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientHandling(PatientHandlingAssembler.create(domHandle));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");

            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:openmaxims-linux    文件:PatientMovementImpl.java   
/**
 * saves Patient Movement
 */
public AssessmentHeaderInfo savePatientMovement(PatientMovement patientMovement, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException
{
    // Ensure the Patient Movement has been validated
    if (!patientMovement.isValidated())
        throw new DomainRuntimeException("Patient Movement has not been validated");

    DomainFactory factory = getDomainFactory();

    PatientMovementHandling domMovement = PatientMovementAssembler.extractPatientMovementHandling(factory, patientMovement);

    factory.save(domMovement);

        /*if (assessment != null)
        {
            AssessmentMobility comp = (AssessmentMobility) component;
            comp.setPatientMovement(PatientMovementAssembler.create(domMovement));
            if (comp.validate() != null)
                throw new DomainRuntimeException("Mobility Component has not been validated");
            return (saveMobilityComponent(assessment, comp));
        }*/

    return null;
}
项目:openmaxims-linux    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, AssessmentComponentType componentTypeVo) 
{
    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    }
    return null;
}
项目:openmaxims-linux    文件:AssessmentComponentImpl.java   
public AssessmentComponent getLastAssessmentComponent(PatientShort patientVo, CareContextRefVo careContextRefVo, AssessmentComponentType componentTypeVo) 
{

    DomainFactory factory = getDomainFactory();

    String hql1 =  "select asmntComp " +
    " from ims.nursing.assessment.domain.objects.AssessmentComponent asmntComp " +
    " where asmntComp.assessment.careContext.episodeOfCare.careSpell.patient.id = :idPatient" +
    " and asmntComp.componentType = :compType" +
    " order by asmntComp.id desc";

    java.util.List<?> components = factory.find(hql1, new String[]{"idPatient", "compType"}, new Object[]{patientVo.getID_Patient(), getDomLookup(componentTypeVo)});

    if ( components != null && ! components.isEmpty()) 
    {
        ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) components.get(0);
        AssessmentComponent copyComp = getComponent(AssessmentComponentAssembler.create(comp));
        copyComp.setAssessmentInfo(null);
        copyComp.setID_AssessmentComponent(null);
        return (copyComp);              
    } 
    return null;            
}
项目:AvoinApotti    文件:NurAssessmentComponentImpl.java   
public AssessmentComponent getComponent(AssessmentComponentRefVo voRefAssessComp)
{
    DomainFactory factory = getDomainFactory();     
    ims.nursing.assessment.domain.objects.AssessmentComponent comp = (ims.nursing.assessment.domain.objects.AssessmentComponent) factory.getDomainObject(ims.nursing.assessment.domain.objects.AssessmentComponent.class, voRefAssessComp.getID_AssessmentComponent());

    if (comp instanceof AccommodationandPropertyComponent)
        return NurAssessmentAccommodationPropertyVoAssembler.create((AccommodationandPropertyComponent)comp);
    else if (comp instanceof BreathingComponent)
        return NurAssessmentBreathingVoAssembler.create((BreathingComponent)comp);
    else if (comp instanceof NurMobilityComponent)
        return NurAssessmentMobilityVoAssembler.create((NurMobilityComponent)comp);
    else if (comp instanceof NurCommunicationComponent)
        return NurAssessmentCommunicationVoAssembler.create((NurCommunicationComponent) comp);
    else if (comp instanceof SafeEnvironmentComponent)
        return NurAssessmentSafeEnvironmentVoAssembler.create((SafeEnvironmentComponent) comp);
    else if (comp instanceof PersonalDetailsComponent)
        return NurAssessmentPersonalDetailsVoAssembler.create((PersonalDetailsComponent) comp);
    else if (comp instanceof NurBowelComponent)
        return NurAssessmentBowelsVoAssembler.create((NurBowelComponent) comp);
    else if (comp instanceof SkinComponent)
        return NurAssessmentSkinVoAssembler.create((SkinComponent) comp);
    else if (comp instanceof NurBladderComponent)
        return NurAssessmentBladderVoAssembler.create((NurBladderComponent) comp);
    else if (comp instanceof CleansingandDressingComponent)
        return NurAssessmentCleansingDressingVoAssembler.create((CleansingandDressingComponent) comp);
    else if (comp instanceof NurEatingComponent)
        return NurAssessmentEatingVoAssembler.create((NurEatingComponent) comp);
    else
    {   
        throw new DomainRuntimeException("Invalid Assessment Component Type Specified (" + comp.getComponentType().toString()+ ")in AssessmentComponentImpl.getComponent");
    }
}
项目:AvoinApotti    文件:PainBodyChartImpl.java   
/**
 * save the PainAssessment Record
 * @throws UniqueKeyViolationException 
 * @throws DomainInterfaceException 
 * **/
public AssessmentHeaderInfo saveRecord(ims.nursing.vo.PainAssessment painAssessment, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException, UniqueKeyViolationException, DomainInterfaceException 
{
    if(painAssessment != null && !painAssessment.isValidated())
        throw new DomainRuntimeException("The PainAssessment has not been validated");

    if (assessment != null && component != null)
    {
        if(!assessment.isValidated())
            throw new DomainRuntimeException("The AssessmentHeaderInfo has not been validated");

        if(!component.isValidated())
            throw new DomainRuntimeException("The AssessmentComponent has not been validated");

        return (savePainAssessmentComponent(assessment, component, painAssessment.getClinicalContact()));
    }
    else
    {
        DomainFactory factory = getDomainFactory();

        ims.nursing.assessmenttools.domain.objects.PainAssessment domPainAssess = PainAssessmentAssembler.extractPainAssessment(factory, painAssessment);
        try
        {               
            factory.save(domPainAssess);
            ims.nursing.vo.PainAssessment voPain = PainAssessmentAssembler.create(domPainAssess);
            return null;
        }
        catch (DomainException e) 
        {
            throw new DomainRuntimeException("DomainException occurred saving Skin Assessment.\r\n" + e.getMessage(), e);
        }
    }       
}
项目:AvoinApotti    文件:NutritionalRiskAssessmentDialogImpl.java   
public AssessmentHeaderInfo saveRecord(NutritionalRiskAssessmentVo nutritionalRiskRecord, AssessmentHeaderInfo assessment, AssessmentComponent component, VitalSignsVo vitalSign) throws StaleObjectException
{
    // Ensure the Value Object was validated
    if (!nutritionalRiskRecord.isValidated())
        throw new DomainRuntimeException("This Nutritional Risk Assessment has not been validated");

    DomainFactory factory = getDomainFactory();         
    NutritionalRiskAssessment domAssessment = NutritionalRiskAssessmentVoAssembler.extractNutritionalRiskAssessment(factory, nutritionalRiskRecord);

    factory.save(domAssessment);

    if(vitalSign != null)
        saveVitalSign(vitalSign);

    if (assessment != null)
    {
        if(component != null && component instanceof NurAssessmentEatingVo)
        {
            NutritionalRiskAssessmentVo nutritionalRisk = NutritionalRiskAssessmentVoAssembler.create(domAssessment);
            nutritionalRisk.validate();

            ((NurAssessmentEatingVo)component).setNutritionalRiskAssessment(nutritionalRisk);
            component.validate();
        }

        assessment.validate();

        return saveEatingComponent(assessment, component, null);
    }
    return null;  // It otherwise expects assessment header
}
项目:AvoinApotti    文件:PatientMovementImpl.java   
/**
     * This method is called when the patient movement/handling form is called
     * from the Assessment Mobility Component form. It will save the mobility
     * component by calling the implementation from
     * AssessmentComponentImpl.java, with the patienthandling and
     * patientmovement details set.
     * @throws UniqueKeyViolationException 
     * @throws DomainInterfaceException 
     */
    public ims.nursing.vo.AssessmentHeaderInfo saveMobilityComponent(ims.nursing.vo.AssessmentHeaderInfo assessment, ims.nursing.vo.AssessmentComponent component) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException, DomainInterfaceException
//  private ims.nursing.vo.AssessmentHeaderInfo saveMobilityComponent(ims.nursing.vo.AssessmentHeaderInfo assessment, ims.nursing.vo.AssessmentComponent component) throws ims.domain.exceptions.StaleObjectException, UniqueKeyViolationException
    {
//      AssessSkin componentImpl = (AssessSkin)getDomainImpl(AssessmentComponentImpl.class);
//      AssessMobility componentImpl = (AssessMobility) getDomainImpl(AssessmentComponentImpl.class);
//      AssessMobility componentImpl = (AssessMobility) getDomainImpl(AssessmentComponentImpl.class);
//      ims.nursing.vo.AssessmentHeaderInfo header = componentImpl.saveComponent(assessment, component);
//      header.setCurrentComponent(componentImpl.getComponent(header.getCurrentComponent()));
///     return header;
        return null;
    }
项目:AvoinApotti    文件:BradenScaleDialogImpl.java   
/**
* Save the record
*/
public AssessmentHeaderInfo saveRecord(ims.nursing.vo.BradenScale bradenScale, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException 
{
    // Ensure the Value Object was validated
    if (!bradenScale.isValidated())
        throw new DomainRuntimeException("This Braden Assessment has not been validated");

    DomainFactory factory = getDomainFactory();         


    BradenScale domAssessment = BradenScaleAssembler.extractBradenScale(factory, bradenScale);

    factory.save(domAssessment);

    if (assessment != null)
    {
        ims.nursing.vo.BradenScale braden = BradenScaleAssembler.create(domAssessment);
        braden.validate();

        if(component != null && component instanceof AssessmentSkin)
            ((AssessmentSkin)component).setBradenScale(braden);

        if(component != null && component instanceof NurAssessmentSkinVo)
            ((NurAssessmentSkinVo)component).setBradenScale(braden);

        component.validate();
        assessment.validate();

        assessment.setCurrentComponent(component);

        return saveAssessmentComponent(assessment, component);
    }

    return null;  // It otherwise expects assessment header
}
项目:AvoinApotti    文件:SkinBodyChartImpl.java   
/** 
 *  save record
 */
public AssessmentHeaderInfo saveRecord(SkinAssessment skinAssessment, AssessmentHeaderInfo assessment, AssessmentComponent component) throws StaleObjectException 
{
    if(!skinAssessment.isValidated())
        throw new DomainRuntimeException("This Skin Assessment has not been validated");

    DomainFactory factory = getDomainFactory();

    ims.nursing.assessmenttools.domain.objects.SkinAssessment domSkinAssess = SkinAssessmentAssembler.extractSkinAssessment(factory, skinAssessment);
    try
    {
        if(domSkinAssess == null)
            throw new DomainException("No Skin Assessment");

        if (assessment != null)
        {
            String[] arrErrors = component.validate();
            if(arrErrors != null)
                throw new DomainRuntimeException("Validation Errors");

            return (saveAssessmentComponent(assessment, component));
        }
        else
        {
            factory.save(domSkinAssess);
            SkinAssessment voSkin = SkinAssessmentAssembler.create(domSkinAssess);
            return null;
        }
    }
    catch (DomainException e) 
    {
        throw new DomainRuntimeException("DomainException occurred saving Skin Assessment.\r\n" + e.getMessage(), e);
    }
}
项目:AvoinApotti    文件:Logic.java   
private void initialise() throws FormOpenException
{
    if (form.getGlobalContext().Core.getCurrentCareContext() == null)
        throw new FormOpenException("Care Context is mandatory for this form.");

    if (!loadRecords(form.getGlobalContext().COE.getInfectionControlAssessment()))
        loadInfectionGridFromLookup();

    if (engine.getPreviousNonDialogFormName().equals(form.getForms().COE.AssessInfectionControl))
    {
        form.btnClose().setVisible(true);
        form.cmbAllRecords().setEnabled(false);
        form.btnNew().setVisible(form.getGlobalContext().COE.getInfectionControlAssessmentIsNotNull() ? false : true);
    }
    else
    {
        form.btnClose().setVisible(false);
        form.cmbAllRecords().setEnabled(true);
        form.btnNew().setVisible(true);
    }

    if (form.cmbAllRecords().getValue() != null)
    {
        AssessmentComponent infectComp = domain.getInfectionComponent(form.cmbAllRecords().getValue());

        if (infectComp != null)
        {
            if (infectComp.getIsComplete())
                form.btnEdit().setEnabled(!(infectComp.getIsComplete()));

        }

    }

}