Java 类ims.core.vo.SocialHistoryVo 实例源码

项目:AvoinApotti    文件:Logic.java   
protected void onBtnNewClick() throws PresentationLogicException 
{
    newOPDFertilityClinic();

    if (form.getLocalContext().getMedSocialHistory() == null)
    {
        SocialHistoryVo socialVo = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
        if(socialVo != null)
        {
            socialVo.setID_SocialHistory(null);
            socialVo.setCareContext(null);
            socialVo.setAuthoringInformation(null);
            socialVo.setClinicalContact(null);
            form.getLocalContext().setMedSocialHistory(socialVo);
        }
        else
            form.getLocalContext().setMedSocialHistory(null);

        populateSocialHistoryScreenFromData();
    }
}
项目:AvoinApotti    文件:Logic.java   
private SocialHistoryVo deleteIdForChildren(SocialHistoryVo socialHistory)
{
    if(socialHistory == null)
        return null;

    if(socialHistory.getSmokingDetails() != null)
    {
        for(int i = 0;i < socialHistory.getSmokingDetails().size();i++)
        {
            socialHistory.getSmokingDetails().get(i).clearIDAndVersion();
        }
    }
    if(socialHistory.getIllicitDrugsList() != null && socialHistory.getIllicitDrugsList().getDrugDetails() != null)
    {
        for(int j = 0;j < socialHistory.getIllicitDrugsList().getDrugDetails().size();j++)
        {
            socialHistory.getIllicitDrugsList().getDrugDetails().get(j).clearIDAndVersion();
        }
    }
    return socialHistory;
}
项目:AvoinApotti    文件:Logic.java   
private void populateIllicitDrugsGrid(SocialHistoryVo value)
{
    form.grdIllicitDrugs().getRows().clear();
    if(value != null && value.getIllicitDrugsList() != null && value.getIllicitDrugsList().getDrugDetails() != null )
    {
        GenForm.grdIllicitDrugsRow rowgrdIllicitDrugs;
        for(int i = 0;i < value.getIllicitDrugsList().getDrugDetails().size();i++)
        {
            if(value.getIllicitDrugsList().getDrugDetails().get(i) != null)
            {
                rowgrdIllicitDrugs = form.grdIllicitDrugs().getRows().newRow();
                rowgrdIllicitDrugs.setColumnStatus(value.getIllicitDrugsList().getDrugDetails().get(i).getCurrentStatus());
                rowgrdIllicitDrugs.setColumnDrug(value.getIllicitDrugsList().getDrugDetails().get(i).getSubstance());
                rowgrdIllicitDrugs.setColumnDateLastUsed(value.getIllicitDrugsList().getDrugDetails().get(i).getLastUsed());
                rowgrdIllicitDrugs.setValue(value.getIllicitDrugsList().getDrugDetails().get(i));
            }
        }
    }
}
项目:AvoinApotti    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null)
        throw new CodingRuntimeException("Contact not Provided");

    DomainFactory factory = getDomainFactory();

    //the following query retrievs the one and only contact of type spinalmedicaladmission if it has been instantiated
    List socialHistory =   factory.find(" from SocialHistory sc where sc.careContext.id = :idCareContext order by sc.systemInformation.creationDateTime desc )",
            new String[]{"idCareContext" },
            new Object[]{ voCareContextRef.getID_CareContext()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;

}
项目:AvoinApotti    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryById(SocialHistoryRefVo socialhostoryref) 
{
    if(socialhostoryref == null || !socialhostoryref.getID_SocialHistoryIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();


    List socialHistory =   factory.find(" from SocialHistory sc where sc.id = :idSocialHistory ",
            new String[]{"idSocialHistory" },
            new Object[]{ socialhostoryref.getID_SocialHistory()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;
}
项目:openMAXIMS    文件:Logic.java   
protected void onBtnNewClick() throws PresentationLogicException 
{
    newOPDFertilityClinic();

    if (form.getLocalContext().getMedSocialHistory() == null)
    {
        SocialHistoryVo socialVo = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
        if(socialVo != null)
        {
            socialVo.setID_SocialHistory(null);
            socialVo.setCareContext(null);
            socialVo.setAuthoringInformation(null);
            socialVo.setClinicalContact(null);
            form.getLocalContext().setMedSocialHistory(socialVo);
        }
        else
            form.getLocalContext().setMedSocialHistory(null);

        populateSocialHistoryScreenFromData();
    }
}
项目:openMAXIMS    文件:Logic.java   
private SocialHistoryVo deleteIdForChildren(SocialHistoryVo socialHistory)
{
    if(socialHistory == null)
        return null;

    if(socialHistory.getSmokingDetails() != null)
    {
        for(int i = 0;i < socialHistory.getSmokingDetails().size();i++)
        {
            socialHistory.getSmokingDetails().get(i).clearIDAndVersion();
        }
    }
    if(socialHistory.getIllicitDrugsList() != null && socialHistory.getIllicitDrugsList().getDrugDetails() != null)
    {
        for(int j = 0;j < socialHistory.getIllicitDrugsList().getDrugDetails().size();j++)
        {
            socialHistory.getIllicitDrugsList().getDrugDetails().get(j).clearIDAndVersion();
        }
    }
    return socialHistory;
}
项目:openMAXIMS    文件:Logic.java   
private void populateIllicitDrugsGrid(SocialHistoryVo value)
{
    form.grdIllicitDrugs().getRows().clear();
    if(value != null && value.getIllicitDrugsList() != null && value.getIllicitDrugsList().getDrugDetails() != null )
    {
        GenForm.grdIllicitDrugsRow rowgrdIllicitDrugs;
        for(int i = 0;i < value.getIllicitDrugsList().getDrugDetails().size();i++)
        {
            if(value.getIllicitDrugsList().getDrugDetails().get(i) != null)
            {
                rowgrdIllicitDrugs = form.grdIllicitDrugs().getRows().newRow();
                rowgrdIllicitDrugs.setColumnStatus(value.getIllicitDrugsList().getDrugDetails().get(i).getCurrentStatus());
                rowgrdIllicitDrugs.setColumnDrug(value.getIllicitDrugsList().getDrugDetails().get(i).getSubstance());
                rowgrdIllicitDrugs.setColumnDateLastUsed(value.getIllicitDrugsList().getDrugDetails().get(i).getLastUsed());
                rowgrdIllicitDrugs.setValue(value.getIllicitDrugsList().getDrugDetails().get(i));
            }
        }
    }
}
项目:openMAXIMS    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null)
        throw new CodingRuntimeException("Contact not Provided");

    DomainFactory factory = getDomainFactory();

    //the following query retrievs the one and only contact of type spinalmedicaladmission if it has been instantiated
    List socialHistory =   factory.find(" from SocialHistory sc where sc.careContext.id = :idCareContext order by sc.systemInformation.creationDateTime desc )",
            new String[]{"idCareContext" },
            new Object[]{ voCareContextRef.getID_CareContext()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;

}
项目:openMAXIMS    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryById(SocialHistoryRefVo socialhostoryref) 
{
    if(socialhostoryref == null || !socialhostoryref.getID_SocialHistoryIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();


    List socialHistory =   factory.find(" from SocialHistory sc where sc.id = :idSocialHistory ",
            new String[]{"idSocialHistory" },
            new Object[]{ socialhostoryref.getID_SocialHistory()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;
}
项目:openMAXIMS    文件:Logic.java   
protected void onBtnNewClick() throws PresentationLogicException 
{
    newOPDFertilityClinic();

    if (form.getLocalContext().getMedSocialHistory() == null)
    {
        SocialHistoryVo socialVo = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
        if(socialVo != null)
        {
            socialVo.setID_SocialHistory(null);
            socialVo.setCareContext(null);
            socialVo.setAuthoringInformation(null);
            socialVo.setClinicalContact(null);
            form.getLocalContext().setMedSocialHistory(socialVo);
        }
        else
            form.getLocalContext().setMedSocialHistory(null);

        populateSocialHistoryScreenFromData();
    }
}
项目:openMAXIMS    文件:Logic.java   
private SocialHistoryVo deleteIdForChildren(SocialHistoryVo socialHistory)
{
    if(socialHistory == null)
        return null;

    if(socialHistory.getSmokingDetails() != null)
    {
        for(int i = 0;i < socialHistory.getSmokingDetails().size();i++)
        {
            socialHistory.getSmokingDetails().get(i).clearIDAndVersion();
        }
    }
    if(socialHistory.getIllicitDrugsList() != null && socialHistory.getIllicitDrugsList().getDrugDetails() != null)
    {
        for(int j = 0;j < socialHistory.getIllicitDrugsList().getDrugDetails().size();j++)
        {
            socialHistory.getIllicitDrugsList().getDrugDetails().get(j).clearIDAndVersion();
        }
    }
    return socialHistory;
}
项目:openMAXIMS    文件:Logic.java   
private void populateIllicitDrugsGrid(SocialHistoryVo value)
{
    form.grdIllicitDrugs().getRows().clear();
    if(value != null && value.getIllicitDrugsList() != null && value.getIllicitDrugsList().getDrugDetails() != null )
    {
        GenForm.grdIllicitDrugsRow rowgrdIllicitDrugs;
        for(int i = 0;i < value.getIllicitDrugsList().getDrugDetails().size();i++)
        {
            if(value.getIllicitDrugsList().getDrugDetails().get(i) != null)
            {
                rowgrdIllicitDrugs = form.grdIllicitDrugs().getRows().newRow();
                rowgrdIllicitDrugs.setColumnStatus(value.getIllicitDrugsList().getDrugDetails().get(i).getCurrentStatus());
                rowgrdIllicitDrugs.setColumnDrug(value.getIllicitDrugsList().getDrugDetails().get(i).getSubstance());
                rowgrdIllicitDrugs.setColumnDateLastUsed(value.getIllicitDrugsList().getDrugDetails().get(i).getLastUsed());
                rowgrdIllicitDrugs.setValue(value.getIllicitDrugsList().getDrugDetails().get(i));
            }
        }
    }
}
项目:openMAXIMS    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null)
        throw new CodingRuntimeException("Contact not Provided");

    DomainFactory factory = getDomainFactory();

    //the following query retrievs the one and only contact of type spinalmedicaladmission if it has been instantiated
    List socialHistory =   factory.find(" from SocialHistory sc where sc.careContext.id = :idCareContext order by sc.systemInformation.creationDateTime desc )",
            new String[]{"idCareContext" },
            new Object[]{ voCareContextRef.getID_CareContext()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;

}
项目:openMAXIMS    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryById(SocialHistoryRefVo socialhostoryref) 
{
    if(socialhostoryref == null || !socialhostoryref.getID_SocialHistoryIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();


    List socialHistory =   factory.find(" from SocialHistory sc where sc.id = :idSocialHistory ",
            new String[]{"idSocialHistory" },
            new Object[]{ socialhostoryref.getID_SocialHistory()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;
}
项目:openmaxims-linux    文件:Logic.java   
protected void onBtnNewClick() throws PresentationLogicException 
{
    newOPDFertilityClinic();

    if (form.getLocalContext().getMedSocialHistory() == null)
    {
        SocialHistoryVo socialVo = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
        if(socialVo != null)
        {
            socialVo.setID_SocialHistory(null);
            socialVo.setCareContext(null);
            socialVo.setAuthoringInformation(null);
            socialVo.setClinicalContact(null);
            form.getLocalContext().setMedSocialHistory(socialVo);
        }
        else
            form.getLocalContext().setMedSocialHistory(null);

        populateSocialHistoryScreenFromData();
    }
}
项目:openmaxims-linux    文件:Logic.java   
private SocialHistoryVo deleteIdForChildren(SocialHistoryVo socialHistory)
{
    if(socialHistory == null)
        return null;

    if(socialHistory.getSmokingDetails() != null)
    {
        for(int i = 0;i < socialHistory.getSmokingDetails().size();i++)
        {
            socialHistory.getSmokingDetails().get(i).clearIDAndVersion();
        }
    }
    if(socialHistory.getIllicitDrugsList() != null && socialHistory.getIllicitDrugsList().getDrugDetails() != null)
    {
        for(int j = 0;j < socialHistory.getIllicitDrugsList().getDrugDetails().size();j++)
        {
            socialHistory.getIllicitDrugsList().getDrugDetails().get(j).clearIDAndVersion();
        }
    }
    return socialHistory;
}
项目:openmaxims-linux    文件:Logic.java   
private void populateIllicitDrugsGrid(SocialHistoryVo value)
{
    form.grdIllicitDrugs().getRows().clear();
    if(value != null && value.getIllicitDrugsList() != null && value.getIllicitDrugsList().getDrugDetails() != null )
    {
        GenForm.grdIllicitDrugsRow rowgrdIllicitDrugs;
        for(int i = 0;i < value.getIllicitDrugsList().getDrugDetails().size();i++)
        {
            if(value.getIllicitDrugsList().getDrugDetails().get(i) != null)
            {
                rowgrdIllicitDrugs = form.grdIllicitDrugs().getRows().newRow();
                rowgrdIllicitDrugs.setColumnStatus(value.getIllicitDrugsList().getDrugDetails().get(i).getCurrentStatus());
                rowgrdIllicitDrugs.setColumnDrug(value.getIllicitDrugsList().getDrugDetails().get(i).getSubstance());
                rowgrdIllicitDrugs.setColumnDateLastUsed(value.getIllicitDrugsList().getDrugDetails().get(i).getLastUsed());
                rowgrdIllicitDrugs.setValue(value.getIllicitDrugsList().getDrugDetails().get(i));
            }
        }
    }
}
项目:openmaxims-linux    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryByCareContext(CareContextRefVo voCareContextRef)
{
    if(voCareContextRef == null)
        throw new CodingRuntimeException("Contact not Provided");

    DomainFactory factory = getDomainFactory();

    //the following query retrievs the one and only contact of type spinalmedicaladmission if it has been instantiated
    List socialHistory =   factory.find(" from SocialHistory sc where sc.careContext.id = :idCareContext order by sc.systemInformation.creationDateTime desc )",
            new String[]{"idCareContext" },
            new Object[]{ voCareContextRef.getID_CareContext()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;

}
项目:openmaxims-linux    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryById(SocialHistoryRefVo socialhostoryref) 
{
    if(socialhostoryref == null || !socialhostoryref.getID_SocialHistoryIsNotNull())
        return null;

    DomainFactory factory = getDomainFactory();


    List socialHistory =   factory.find(" from SocialHistory sc where sc.id = :idSocialHistory ",
            new String[]{"idSocialHistory" },
            new Object[]{ socialhostoryref.getID_SocialHistory()});

    SocialHistoryVoCollection voCollSocialHistory = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socialHistory);

    if(voCollSocialHistory.size()>0)
        return voCollSocialHistory.get(0);
    else 
        return null;
}
项目:AvoinApotti    文件:Logic.java   
private void populateSocialHistoryScreenFromData()
{
    clearSocialHistoryControls();

    if (form.getLocalContext().getMedSocialHistoryIsNotNull())
    {
        SocialHistoryVo voSocHist = form.getLocalContext().getMedSocialHistory();

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getMaritalStatusIsNotNull()))
            form.cmbMaritalStatus().setValue(voSocHist.getMaritalStatus().getMaritalStatus());

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getStatusDateIsNotNull()))
            form.pdtMYear().setValue(voSocHist.getMaritalStatus().getStatusDate());
    }
}
项目:AvoinApotti    文件:Logic.java   
protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException
{
    clearScreen();
    loadLookupsIntoGrid();
    form.setMode(FormMode.EDIT);
    form.setcustomControlAuthoringInfoEnabled(true);
    //wdev-13067
    form.customControlAuthoringInfo().setIsRequiredPropertyToControls(true);
    //---------
    setDefaultValues();
    form.dteClinic().setValue(form.getGlobalContext().Core.getCurrentCareContext().getStartDateTime().getDate());

    SocialHistoryVo socialVo = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
    if (socialVo != null)
    {
        socialVo.setID_SocialHistory(null);
        socialVo.setCareContext(null);
        socialVo.setAuthoringInformation(null);
        socialVo.setClinicalContact(null);

        form.getLocalContext().setMedSocialHistory(socialVo);
    }
    else
        form.getLocalContext().setMedSocialHistory(null);

    populateSocialHistoryScreenFromData();

}
项目:AvoinApotti    文件:Logic.java   
private void populateSocialHistoryScreenFromData()
{
    clearSocialHistoryControls();

    if (form.getLocalContext().getMedSocialHistoryIsNotNull())
    {
        SocialHistoryVo voSocHist = form.getLocalContext().getMedSocialHistory();

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getMaritalStatusIsNotNull()))
            form.container1().cmbMaritalStatus().setValue(voSocHist.getMaritalStatus().getMaritalStatus());

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getStatusDateIsNotNull()))
            form.container1().pdtYear().setValue(voSocHist.getMaritalStatus().getStatusDate());
    }
}
项目:AvoinApotti    文件:OPDEDClinicNotesImpl.java   
public SocialHistoryVo getMedSocialHistory(ClinicalContactShortVo voClinicalContactShort)
{
    SocialHistoryVoCollection voCollSocHist = new SocialHistoryVoCollection();

    DomainFactory factory = getDomainFactory();

    String hql = " from SocialHistory socHist ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

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

    if (voClinicalContactShort.getID_ClinicalContactIsNotNull())
    {
        condStr.append(andStr + " socHist.clinicalContact.id = :id_ClinicalContact");
        markers.add("id_ClinicalContact");
        values.add(voClinicalContactShort.getID_ClinicalContact().toString());
        andStr = " and ";
    }

    if (andStr.equals(" and "))
        hql += " where ";

    hql += condStr.toString();
    voCollSocHist = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(factory.find(hql, markers, values));
    if (voCollSocHist.size() > 0)
        return voCollSocHist.get(0);
    else
        return null;
}
项目:AvoinApotti    文件:OPDEDClinicNotesImpl.java   
public void saveMedSocialHistory(SocialHistoryVo voSocialHistory) throws StaleObjectException
{
    // Ensure the value object has been validated
    if (!voSocialHistory.isValidated())
        throw new DomainRuntimeException("Social History has not been validated");

    DomainFactory factory = getDomainFactory();
    SocialHistory doSocHist = SocialHistoryVoAssembler.extractSocialHistory(factory, voSocialHistory);
    factory.save(doSocHist);
    return;
}
项目:AvoinApotti    文件:OPDEDClinicNotesImpl.java   
public SocialHistoryVo getMedSocialHistoryByCareContext(CareContextLiteVo voCareContext)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer();
    String query = " from SocialHistory socHist ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if(voCareContext.getEpisodeOfCareIsNotNull())
    {
        hql.append(andStr + " socHist.careContext.id = :ec");
        markers.add("ec");
        values.add(voCareContext.getID_CareContext());
        andStr = " and ";
    }

    if (markers.size() > 0) query += " where ";
    query += hql.toString();    

    query += " and socHist.isRIE is null";

    java.util.List socHistList = factory.find(query,markers,values);
    SocialHistoryVoCollection voCollSocHist  = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socHistList);

    if(voCollSocHist.size()>0)
        return voCollSocHist.get(0);
    else
        return null;
}
项目:AvoinApotti    文件:OPDFertilityCLinicImpl.java   
public void saveMedSocialHistory(SocialHistoryVo voSocialHistory) throws StaleObjectException 
{
    // Ensure the value object has been validated
    if (!voSocialHistory.isValidated())
        throw new DomainRuntimeException("Social History has not been validated");

    DomainFactory factory = getDomainFactory();
    SocialHistory doSocHist = SocialHistoryVoAssembler.extractSocialHistory(factory, voSocialHistory);

    factory.save(doSocHist);

    return;
}
项目:AvoinApotti    文件:Logic.java   
protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException
{
    clearScreen();

    SocialHistoryVo socialHistory = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
    populateScreenFromData(deleteIdForChildren(socialHistory == null ? null:(SocialHistoryVo)socialHistory.clone()),false);
    if(engine.getFormName().equals(form.getForms().Core.SocialHistory))
    {
        ClinicalContactShortVo voClinicalContact = form.getGlobalContext().Core.getCurrentClinicalContact();
        if(voClinicalContact != null)
        {
            AuthoringInformationVo voAuth = new AuthoringInformationVo();
            voAuth.setAuthoringDateTime(voClinicalContact.getStartDateTime());
            voAuth.setAuthoringHcp(voClinicalContact.getSeenBy());
            form.customControlAuth().setValue(voAuth);

            //WDEV-12901 
            Object mos = domain.getMosUser();
            if(mos != null){
                form.cmbRecordingHCP().newRow((MemberOfStaffLiteVo)mos, mos.toString());
                form.cmbRecordingHCP().setValue((MemberOfStaffLiteVo)mos);
            }
            form.dtimRecordingDateTime().setValue(new DateTime());
        }
        else
            setDefaultValues();//wdev-1930
    }
    else
    {
        setDefaultValues();
    }

    form.getLocalContext().setvoSocialHistory(null);
    form.setMode(FormMode.EDIT);
    form.customControlAuth().setIsRequiredPropertyToControls(true);
    updateControlsState();
    updateContextMenus();
}
项目:AvoinApotti    文件:Logic.java   
private void open()
{
    clearScreen();
    SocialHistoryVo socialHistory = null;

    //populate record browser
    populateRecordBrwoser(domain.getSocialHistoryByPatientColl(form.getGlobalContext().Core.getPatientShort()));

    if (engine.getFormName().equals(form.getForms().Core.SocialHistoryCoreClinicalRecord))
        socialHistory = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
    else
    {
        socialHistory = domain.getSocialHistoryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());
        if (socialHistory != null)
        {
            form.getLocalContext().setcurrentSocialHistory(socialHistory);  
            form.getLocalContext().setvoSocialHistory(socialHistory);   
            form.recbrSocialHistory().setValue(socialHistory);
            populateScreenFromData(form.getLocalContext().getcurrentSocialHistory(),true);
            updateControlsState();
            return;
        }
    }

    form.getLocalContext().setcurrentSocialHistory(socialHistory);  

    form.getLocalContext().setvoSocialHistory(domain.getSocialHistoryById(form.recbrSocialHistory().getValue()));

    populateScreenFromData(form.getLocalContext().getvoSocialHistory(),true);

    updateControlsState();
}
项目:AvoinApotti    文件:Logic.java   
private void displaySocialHistory()
{
    SocialHistoryVo voSocialHistory = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
    if(voSocialHistory != null)
    {
        form.cmbLives().setValue(voSocialHistory.getLivesWith());
        form.cmbFitToCare().setValue(voSocialHistory.getFitToCareForPatient());
        form.cmbTakeHome().setValue(voSocialHistory.getFitToTakeHome());
    }
}
项目:AvoinApotti    文件:SocialHistoryImpl.java   
public SocialHistoryVo saveSocialHistory(SocialHistoryVo voSocialHistory) throws StaleObjectException
{
    if(voSocialHistory == null || !voSocialHistory.isValidated())
        throw new CodingRuntimeException("Social History Value Object is null or has not been validated");

    if (voSocialHistory.getID_SocialHistory() == null && getSocialHistoryByCareContext(voSocialHistory.getCareContext()) != null)
        throw new StaleObjectException(null, "A Social History record already exists for this Care Context, the screen will be refreshed.");

    DomainFactory factory = getDomainFactory();
    SocialHistory domSocialHistory = SocialHistoryVoAssembler.extractSocialHistory(factory,voSocialHistory);
    factory.save(domSocialHistory);

    return SocialHistoryVoAssembler.create(domSocialHistory);
}
项目:AvoinApotti    文件:SocialHistoryImpl.java   
public SocialHistoryVo getSocialHistoryByPatient(PatientRefVo patient)
{
    if(patient == null || patient.getID_Patient() == null)
        throw new CodingRuntimeException("Patient not Provided to retrive Core Clinical - Social History record");

    DomainFactory factory = getDomainFactory();

    String hql = "from SocialHistory socHist where socHist.careContext.episodeOfCare.careSpell.patient.id = :idPatient order by socHist.systemInformation.creationDateTime desc";
    List socialHistory = factory.find(hql, new String[] {"idPatient"}, new Object[] {patient.getID_Patient()});
    if (socialHistory != null && socialHistory.size() > 0)
        return SocialHistoryVoAssembler.create((SocialHistory) socialHistory.get(0));

    return null;
}
项目:openMAXIMS    文件:Logic.java   
private void populateSocialHistoryScreenFromData()
{
    clearSocialHistoryControls();

    if (form.getLocalContext().getMedSocialHistoryIsNotNull())
    {
        SocialHistoryVo voSocHist = form.getLocalContext().getMedSocialHistory();

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getMaritalStatusIsNotNull()))
            form.cmbMaritalStatus().setValue(voSocHist.getMaritalStatus().getMaritalStatus());

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getStatusDateIsNotNull()))
            form.pdtMYear().setValue(voSocHist.getMaritalStatus().getStatusDate());
    }
}
项目:openMAXIMS    文件:Logic.java   
protected void onBtnNewClick() throws ims.framework.exceptions.PresentationLogicException
{
    clearScreen();
    loadLookupsIntoGrid();
    form.setMode(FormMode.EDIT);
    form.setcustomControlAuthoringInfoEnabled(true);
    //wdev-13067
    form.customControlAuthoringInfo().setIsRequiredPropertyToControls(true);
    //---------
    setDefaultValues();
    form.dteClinic().setValue(form.getGlobalContext().Core.getCurrentCareContext().getStartDateTime().getDate());

    SocialHistoryVo socialVo = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
    if (socialVo != null)
    {
        socialVo.setID_SocialHistory(null);
        socialVo.setCareContext(null);
        socialVo.setAuthoringInformation(null);
        socialVo.setClinicalContact(null);

        form.getLocalContext().setMedSocialHistory(socialVo);
    }
    else
        form.getLocalContext().setMedSocialHistory(null);

    populateSocialHistoryScreenFromData();

}
项目:openMAXIMS    文件:Logic.java   
private void populateSocialHistoryScreenFromData()
{
    clearSocialHistoryControls();

    if (form.getLocalContext().getMedSocialHistoryIsNotNull())
    {
        SocialHistoryVo voSocHist = form.getLocalContext().getMedSocialHistory();

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getMaritalStatusIsNotNull()))
            form.container1().cmbMaritalStatus().setValue(voSocHist.getMaritalStatus().getMaritalStatus());

        if ((voSocHist.getMaritalStatusIsNotNull()) && (voSocHist.getMaritalStatus().getStatusDateIsNotNull()))
            form.container1().pdtYear().setValue(voSocHist.getMaritalStatus().getStatusDate());
    }
}
项目:openMAXIMS    文件:OPDEDClinicNotesImpl.java   
public SocialHistoryVo getMedSocialHistory(ClinicalContactShortVo voClinicalContactShort)
{
    SocialHistoryVoCollection voCollSocHist = new SocialHistoryVoCollection();

    DomainFactory factory = getDomainFactory();

    String hql = " from SocialHistory socHist ";
    StringBuffer condStr = new StringBuffer();
    String andStr = " ";

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

    if (voClinicalContactShort.getID_ClinicalContactIsNotNull())
    {
        condStr.append(andStr + " socHist.clinicalContact.id = :id_ClinicalContact");
        markers.add("id_ClinicalContact");
        values.add(voClinicalContactShort.getID_ClinicalContact().toString());
        andStr = " and ";
    }

    if (andStr.equals(" and "))
        hql += " where ";

    hql += condStr.toString();
    voCollSocHist = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(factory.find(hql, markers, values));
    if (voCollSocHist.size() > 0)
        return voCollSocHist.get(0);
    else
        return null;
}
项目:openMAXIMS    文件:OPDEDClinicNotesImpl.java   
public void saveMedSocialHistory(SocialHistoryVo voSocialHistory) throws StaleObjectException
{
    // Ensure the value object has been validated
    if (!voSocialHistory.isValidated())
        throw new DomainRuntimeException("Social History has not been validated");

    DomainFactory factory = getDomainFactory();
    SocialHistory doSocHist = SocialHistoryVoAssembler.extractSocialHistory(factory, voSocialHistory);
    factory.save(doSocHist);
    return;
}
项目:openMAXIMS    文件:OPDEDClinicNotesImpl.java   
public SocialHistoryVo getMedSocialHistoryByCareContext(CareContextLiteVo voCareContext)
{
    DomainFactory factory = getDomainFactory();
    StringBuffer hql = new StringBuffer();
    String query = " from SocialHistory socHist ";
    ArrayList markers= new ArrayList();
    ArrayList values = new ArrayList();
    String andStr = " ";

    if(voCareContext.getEpisodeOfCareIsNotNull())
    {
        hql.append(andStr + " socHist.careContext.id = :ec");
        markers.add("ec");
        values.add(voCareContext.getID_CareContext());
        andStr = " and ";
    }

    if (markers.size() > 0) query += " where ";
    query += hql.toString();    

    query += " and socHist.isRIE is null";

    java.util.List socHistList = factory.find(query,markers,values);
    SocialHistoryVoCollection voCollSocHist  = SocialHistoryVoAssembler.createSocialHistoryVoCollectionFromSocialHistory(socHistList);

    if(voCollSocHist.size()>0)
        return voCollSocHist.get(0);
    else
        return null;
}
项目:openMAXIMS    文件:OPDFertilityCLinicImpl.java   
public void saveMedSocialHistory(SocialHistoryVo voSocialHistory) throws StaleObjectException 
{
    // Ensure the value object has been validated
    if (!voSocialHistory.isValidated())
        throw new DomainRuntimeException("Social History has not been validated");

    DomainFactory factory = getDomainFactory();
    SocialHistory doSocHist = SocialHistoryVoAssembler.extractSocialHistory(factory, voSocialHistory);

    factory.save(doSocHist);

    return;
}
项目:openMAXIMS    文件:Logic.java   
private void open()
{
    clearScreen();
    SocialHistoryVo socialHistory = null;

    //populate record browser
    populateRecordBrwoser(domain.getSocialHistoryByPatientColl(form.getGlobalContext().Core.getPatientShort()));

    if (engine.getFormName().equals(form.getForms().Core.SocialHistoryCoreClinicalRecord))
        socialHistory = domain.getSocialHistoryByPatient(form.getGlobalContext().Core.getPatientShort());
    else
    {
        socialHistory = domain.getSocialHistoryByCareContext(form.getGlobalContext().Core.getCurrentCareContext());
        if (socialHistory != null)
        {
            form.getLocalContext().setcurrentSocialHistory(socialHistory);  
            form.getLocalContext().setvoSocialHistory(socialHistory);   
            form.recbrSocialHistory().setValue(socialHistory);
            populateScreenFromData(form.getLocalContext().getcurrentSocialHistory(),true);
            updateControlsState();
            return;
        }
    }

    form.getLocalContext().setcurrentSocialHistory(socialHistory);  

    form.getLocalContext().setvoSocialHistory(domain.getSocialHistoryById(form.recbrSocialHistory().getValue()));

    populateScreenFromData(form.getLocalContext().getvoSocialHistory(),true);

    updateControlsState();
}