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

项目:AvoinApotti    文件:Logic.java   
protected void populateScreenFromData(ims.core.vo.SocialHistoryVo value, Boolean authoring)
{
    if (value == null)
        return;


    super.populateScreenFromData(value);
    if(authoring == true)
        form.customControlAuth().setValue(value.getAuthoringInformation()); 
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    //wdev-12650
    this.form.cmbOccupationStatus().setRequired(form.cmbOccupation().getValue() != null);
    //------------
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

    if(value.getRecordingInformationIsNotNull()){
        MemberOfStaffLiteVo mos = value.getRecordingInformation().getRecordingUser();
        if(mos!=null){
            form.cmbRecordingHCP().newRow(mos, mos.toString());
            form.cmbRecordingHCP().setValue(mos);   
        }
        form.dtimRecordingDateTime().setValue(value.getRecordingInformation().getRecordingDateTime());
    }



}
项目:AvoinApotti    文件:Logic.java   
private void populateRestScreenFromData(SocialHistoryVo value)
{
    if(value == null)
        return;
    super.populateScreenFromData(value);
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

}
项目:AvoinApotti    文件:Logic.java   
protected SocialHistoryVo populateDataFromScreen(SocialHistoryVo value)
{
    if(validateMaritalDate())
        return null;


    value = super.populateDataFromScreen(value);

    //SystemInformation sysInfo = new SystemInformation();
    //sysInfo.setCreationDateTime(new DateTime());

    value.setSocialHistoryNotes(this.form.txtGeneralNotes().getValue());

    // ----- Start of grdSmokingDetails Grid --------------------------
    value.setSmokingDetails(new ims.core.vo.SmokingDetailsCollection());
    for (int x = 0; x < this.form.grdSmokingDetails().getRows().size(); x++)
    {
        boolean bAddVO = false;
        ims.core.vo.SmokingDetails rowValue = this.form.grdSmokingDetails().getRows().get(x).getValue();
        if (rowValue == null)
            rowValue = new ims.core.vo.SmokingDetails();

        rowValue.setStatus(this.form.grdSmokingDetails().getRows().get(x).getColStatus());
        bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColStatus() != null ? true : false;

        rowValue.setSmokingWhat(this.form.grdSmokingDetails().getRows().get(x).getColWhat());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhat() != null ? true : false;

        rowValue.setAmountPerDay(this.form.grdSmokingDetails().getRows().get(x).getColAmt());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColAmt() != null ? true : false;

        rowValue.setNumberOfYears(this.form.grdSmokingDetails().getRows().get(x).getColNrYrs());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColNrYrs() != null ? true : false;

        rowValue.setWhenStopped(this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped() != null ? true : false;

        if (bAddVO && value.getSmokingDetailsIsNotNull())
            value.getSmokingDetails().add(rowValue);
    }
    // ----- End of grdSmokingDetails Grid ----------------------------
    value.setAuthoringInformation(form.customControlAuth().getValue());

    AlcoholVo alcohol = new AlcoholVo();
    alcohol.setDoYouDrinkAlcohol(form.cmbAlcoholStatus().getValue());
    alcohol.setUnitsPerDay(form.intUnitsPerDay().getValue());
    alcohol.setDescriptiveHistory(form.txtTakenLastWeek().getValue());

    value.setAlcohol(alcohol);

    // Save Marital Status Info
    SocialHistoryMaritalStatusVo voMaritalStatus = new SocialHistoryMaritalStatusVo();
    voMaritalStatus.setMaritalStatus(form.cmbMaritalStat().getValue());

    voMaritalStatus.setStatusDate(form.pdtMaritalStatus().getValue());
    value.setMaritalStatus(voMaritalStatus);

    if(value.getIllicitDrugsList() == null)
        value.setIllicitDrugsList(new IllicitDrugsVo());

    value = populateDataFromIllicitDrugsGrid(value);
    value.getIllicitDrugsList().setDrugsUsedIntravenously(form.ansIVUser().getValue());

    //WDEV-12901 set Recording Information
    if(value.getRecordingInformation()==null){
        RecordingUserInformationVo voRecordingUserInformation = new RecordingUserInformationVo();
        voRecordingUserInformation.setRecordingUser(form.cmbRecordingHCP().getValue());
        voRecordingUserInformation.setRecordingDateTime(new DateTime());
        value.setRecordingInformation(voRecordingUserInformation);
    }

    return value;
}
项目:openMAXIMS    文件:Logic.java   
protected void populateScreenFromData(ims.core.vo.SocialHistoryVo value, Boolean authoring)
{
    if (value == null)
        return;


    super.populateScreenFromData(value);
    if(authoring == true)
        form.customControlAuth().setValue(value.getAuthoringInformation()); 
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    //wdev-12650
    this.form.cmbOccupationStatus().setRequired(form.cmbOccupation().getValue() != null);
    //------------
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

    if(value.getRecordingInformationIsNotNull()){
        MemberOfStaffLiteVo mos = value.getRecordingInformation().getRecordingUser();
        if(mos!=null){
            form.cmbRecordingHCP().newRow(mos, mos.toString());
            form.cmbRecordingHCP().setValue(mos);   
        }
        form.dtimRecordingDateTime().setValue(value.getRecordingInformation().getRecordingDateTime());
    }



}
项目:openMAXIMS    文件:Logic.java   
private void populateRestScreenFromData(SocialHistoryVo value)
{
    if(value == null)
        return;
    super.populateScreenFromData(value);
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

}
项目:openMAXIMS    文件:Logic.java   
protected SocialHistoryVo populateDataFromScreen(SocialHistoryVo value)
{
    if(validateMaritalDate())
        return null;


    value = super.populateDataFromScreen(value);

    //SystemInformation sysInfo = new SystemInformation();
    //sysInfo.setCreationDateTime(new DateTime());

    value.setSocialHistoryNotes(this.form.txtGeneralNotes().getValue());

    // ----- Start of grdSmokingDetails Grid --------------------------
    value.setSmokingDetails(new ims.core.vo.SmokingDetailsCollection());
    for (int x = 0; x < this.form.grdSmokingDetails().getRows().size(); x++)
    {
        boolean bAddVO = false;
        ims.core.vo.SmokingDetails rowValue = this.form.grdSmokingDetails().getRows().get(x).getValue();
        if (rowValue == null)
            rowValue = new ims.core.vo.SmokingDetails();

        rowValue.setStatus(this.form.grdSmokingDetails().getRows().get(x).getColStatus());
        bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColStatus() != null ? true : false;

        rowValue.setSmokingWhat(this.form.grdSmokingDetails().getRows().get(x).getColWhat());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhat() != null ? true : false;

        rowValue.setAmountPerDay(this.form.grdSmokingDetails().getRows().get(x).getColAmt());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColAmt() != null ? true : false;

        rowValue.setNumberOfYears(this.form.grdSmokingDetails().getRows().get(x).getColNrYrs());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColNrYrs() != null ? true : false;

        rowValue.setWhenStopped(this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped() != null ? true : false;

        if (bAddVO && value.getSmokingDetailsIsNotNull())
            value.getSmokingDetails().add(rowValue);
    }
    // ----- End of grdSmokingDetails Grid ----------------------------
    value.setAuthoringInformation(form.customControlAuth().getValue());

    AlcoholVo alcohol = new AlcoholVo();
    alcohol.setDoYouDrinkAlcohol(form.cmbAlcoholStatus().getValue());
    alcohol.setUnitsPerDay(form.intUnitsPerDay().getValue());
    alcohol.setDescriptiveHistory(form.txtTakenLastWeek().getValue());

    value.setAlcohol(alcohol);

    // Save Marital Status Info
    SocialHistoryMaritalStatusVo voMaritalStatus = new SocialHistoryMaritalStatusVo();
    voMaritalStatus.setMaritalStatus(form.cmbMaritalStat().getValue());

    voMaritalStatus.setStatusDate(form.pdtMaritalStatus().getValue());
    value.setMaritalStatus(voMaritalStatus);

    if(value.getIllicitDrugsList() == null)
        value.setIllicitDrugsList(new IllicitDrugsVo());

    value = populateDataFromIllicitDrugsGrid(value);
    value.getIllicitDrugsList().setDrugsUsedIntravenously(form.ansIVUser().getValue());

    //WDEV-12901 set Recording Information
    if(value.getRecordingInformation()==null){
        RecordingUserInformationVo voRecordingUserInformation = new RecordingUserInformationVo();
        voRecordingUserInformation.setRecordingUser(form.cmbRecordingHCP().getValue());
        voRecordingUserInformation.setRecordingDateTime(new DateTime());
        value.setRecordingInformation(voRecordingUserInformation);
    }

    return value;
}
项目:openMAXIMS    文件:Logic.java   
protected void populateScreenFromData(ims.core.vo.SocialHistoryVo value, Boolean authoring)
{
    if (value == null)
        return;


    super.populateScreenFromData(value);
    if(authoring == true)
        form.customControlAuth().setValue(value.getAuthoringInformation()); 
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    //wdev-12650
    this.form.cmbOccupationStatus().setRequired(form.cmbOccupation().getValue() != null);
    //------------
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

    if(value.getRecordingInformationIsNotNull()){
        MemberOfStaffLiteVo mos = value.getRecordingInformation().getRecordingUser();
        if(mos!=null){
            form.cmbRecordingHCP().newRow(mos, mos.toString());
            form.cmbRecordingHCP().setValue(mos);   
        }
        form.dtimRecordingDateTime().setValue(value.getRecordingInformation().getRecordingDateTime());
    }



}
项目:openMAXIMS    文件:Logic.java   
private void populateRestScreenFromData(SocialHistoryVo value)
{
    if(value == null)
        return;
    super.populateScreenFromData(value);
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

}
项目:openMAXIMS    文件:Logic.java   
protected SocialHistoryVo populateDataFromScreen(SocialHistoryVo value)
{
    if(validateMaritalDate())
        return null;


    value = super.populateDataFromScreen(value);

    //SystemInformation sysInfo = new SystemInformation();
    //sysInfo.setCreationDateTime(new DateTime());

    value.setSocialHistoryNotes(this.form.txtGeneralNotes().getValue());

    // ----- Start of grdSmokingDetails Grid --------------------------
    value.setSmokingDetails(new ims.core.vo.SmokingDetailsCollection());
    for (int x = 0; x < this.form.grdSmokingDetails().getRows().size(); x++)
    {
        boolean bAddVO = false;
        ims.core.vo.SmokingDetails rowValue = this.form.grdSmokingDetails().getRows().get(x).getValue();
        if (rowValue == null)
            rowValue = new ims.core.vo.SmokingDetails();

        rowValue.setStatus(this.form.grdSmokingDetails().getRows().get(x).getColStatus());
        bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColStatus() != null ? true : false;

        rowValue.setSmokingWhat(this.form.grdSmokingDetails().getRows().get(x).getColWhat());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhat() != null ? true : false;

        rowValue.setAmountPerDay(this.form.grdSmokingDetails().getRows().get(x).getColAmt());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColAmt() != null ? true : false;

        rowValue.setNumberOfYears(this.form.grdSmokingDetails().getRows().get(x).getColNrYrs());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColNrYrs() != null ? true : false;

        rowValue.setWhenStopped(this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped() != null ? true : false;

        if (bAddVO && value.getSmokingDetailsIsNotNull())
            value.getSmokingDetails().add(rowValue);
    }
    // ----- End of grdSmokingDetails Grid ----------------------------
    value.setAuthoringInformation(form.customControlAuth().getValue());

    AlcoholVo alcohol = new AlcoholVo();
    alcohol.setDoYouDrinkAlcohol(form.cmbAlcoholStatus().getValue());
    alcohol.setUnitsPerDay(form.intUnitsPerDay().getValue());
    alcohol.setDescriptiveHistory(form.txtTakenLastWeek().getValue());

    value.setAlcohol(alcohol);

    // Save Marital Status Info
    SocialHistoryMaritalStatusVo voMaritalStatus = new SocialHistoryMaritalStatusVo();
    voMaritalStatus.setMaritalStatus(form.cmbMaritalStat().getValue());

    voMaritalStatus.setStatusDate(form.pdtMaritalStatus().getValue());
    value.setMaritalStatus(voMaritalStatus);

    if(value.getIllicitDrugsList() == null)
        value.setIllicitDrugsList(new IllicitDrugsVo());

    value = populateDataFromIllicitDrugsGrid(value);
    value.getIllicitDrugsList().setDrugsUsedIntravenously(form.ansIVUser().getValue());

    //WDEV-12901 set Recording Information
    if(value.getRecordingInformation()==null){
        RecordingUserInformationVo voRecordingUserInformation = new RecordingUserInformationVo();
        voRecordingUserInformation.setRecordingUser(form.cmbRecordingHCP().getValue());
        voRecordingUserInformation.setRecordingDateTime(new DateTime());
        value.setRecordingInformation(voRecordingUserInformation);
    }

    return value;
}
项目:openmaxims-linux    文件:Logic.java   
protected void populateScreenFromData(ims.core.vo.SocialHistoryVo value, Boolean authoring)
{
    if (value == null)
        return;


    super.populateScreenFromData(value);
    if(authoring == true)
        form.customControlAuth().setValue(value.getAuthoringInformation()); 
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    //wdev-12650
    this.form.cmbOccupationStatus().setRequired(form.cmbOccupation().getValue() != null);
    //------------
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

    if(value.getRecordingInformationIsNotNull()){
        MemberOfStaffLiteVo mos = value.getRecordingInformation().getRecordingUser();
        if(mos!=null){
            form.cmbRecordingHCP().newRow(mos, mos.toString());
            form.cmbRecordingHCP().setValue(mos);   
        }
        form.dtimRecordingDateTime().setValue(value.getRecordingInformation().getRecordingDateTime());
    }



}
项目:openmaxims-linux    文件:Logic.java   
private void populateRestScreenFromData(SocialHistoryVo value)
{
    if(value == null)
        return;
    super.populateScreenFromData(value);
    // ----- Start of grdSmokingDetails Grid --------------------------
    ims.core.vo.SmokingDetailsCollection fieldgrdSmokingDetails = value.getSmokingDetailsIsNotNull() ? value.getSmokingDetails() : null;
    if (fieldgrdSmokingDetails != null)
    {
        GenForm.grdSmokingDetailsRow rowgrdSmokingDetails;
        for (int x = 0; x < fieldgrdSmokingDetails.size(); x++)
        {
            if (fieldgrdSmokingDetails.get(x) != null)
            {
                rowgrdSmokingDetails = this.form.grdSmokingDetails().getRows().newRow();

                rowgrdSmokingDetails.setColStatus(fieldgrdSmokingDetails.get(x).getStatus());
                rowgrdSmokingDetails.setColWhat(fieldgrdSmokingDetails.get(x).getSmokingWhat());
                rowgrdSmokingDetails.setColAmt(fieldgrdSmokingDetails.get(x).getAmountPerDay());
                rowgrdSmokingDetails.setColNrYrs(fieldgrdSmokingDetails.get(x).getNumberOfYears());
                rowgrdSmokingDetails.setColWhenStopped(fieldgrdSmokingDetails.get(x).getWhenStopped());

                if (rowgrdSmokingDetails.getColStatus() != null)
                {
                    if (rowgrdSmokingDetails.getColStatus().equals(SmokingCurrentHistoric.CURRENT))
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(true);
                    else
                        rowgrdSmokingDetails.setColWhenStoppedReadOnly(false);
                }

                rowgrdSmokingDetails.setValue(fieldgrdSmokingDetails.get(x));
            }
        }
    }
    // ----- End of grdSmokingDetails Grid ----------------------------

    this.form.txtIllicitDrugs().setValue(value.getIllicitDrugs());
    this.form.cmbSmokingStatus().setValue(value.getSmokingStatus());
    this.form.cmbOccupation().setValue(value.getOccupation());
    this.form.cmbOccupationStatus().setValue(value.getOccupationStatus());
    this.form.cmbLivesWith().setValue(value.getLivesWith());

    AlcoholVo voAlcohol = value.getAlcohol();
    if (voAlcohol != null)
    {
        form.cmbAlcoholStatus().setValue(voAlcohol.getDoYouDrinkAlcohol());
        form.intUnitsPerDay().setValue(voAlcohol.getUnitsPerDay());
        form.txtTakenLastWeek().setValue(voAlcohol.getDescriptiveHistory());
    }

    SocialHistoryMaritalStatusVo voMaritalStatus = value.getMaritalStatus();
    if (voMaritalStatus != null)
    {
        form.cmbMaritalStat().setValue(voMaritalStatus.getMaritalStatus());
        form.pdtMaritalStatus().setValue(voMaritalStatus.getStatusDate());
    }
    populateIllicitDrugsGrid(value);
    if(value.getIllicitDrugsList() != null)
        form.ansIVUser().setValue(value.getIllicitDrugsList().getDrugsUsedIntravenously());

}
项目:openmaxims-linux    文件:Logic.java   
protected SocialHistoryVo populateDataFromScreen(SocialHistoryVo value)
{
    if(validateMaritalDate())
        return null;


    value = super.populateDataFromScreen(value);

    //SystemInformation sysInfo = new SystemInformation();
    //sysInfo.setCreationDateTime(new DateTime());

    value.setSocialHistoryNotes(this.form.txtGeneralNotes().getValue());

    // ----- Start of grdSmokingDetails Grid --------------------------
    value.setSmokingDetails(new ims.core.vo.SmokingDetailsCollection());
    for (int x = 0; x < this.form.grdSmokingDetails().getRows().size(); x++)
    {
        boolean bAddVO = false;
        ims.core.vo.SmokingDetails rowValue = this.form.grdSmokingDetails().getRows().get(x).getValue();
        if (rowValue == null)
            rowValue = new ims.core.vo.SmokingDetails();

        rowValue.setStatus(this.form.grdSmokingDetails().getRows().get(x).getColStatus());
        bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColStatus() != null ? true : false;

        rowValue.setSmokingWhat(this.form.grdSmokingDetails().getRows().get(x).getColWhat());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhat() != null ? true : false;

        rowValue.setAmountPerDay(this.form.grdSmokingDetails().getRows().get(x).getColAmt());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColAmt() != null ? true : false;

        rowValue.setNumberOfYears(this.form.grdSmokingDetails().getRows().get(x).getColNrYrs());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColNrYrs() != null ? true : false;

        rowValue.setWhenStopped(this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped());
        if (bAddVO == false)
            bAddVO = this.form.grdSmokingDetails().getRows().get(x).getColWhenStopped() != null ? true : false;

        if (bAddVO && value.getSmokingDetailsIsNotNull())
            value.getSmokingDetails().add(rowValue);
    }
    // ----- End of grdSmokingDetails Grid ----------------------------
    value.setAuthoringInformation(form.customControlAuth().getValue());

    AlcoholVo alcohol = new AlcoholVo();
    alcohol.setDoYouDrinkAlcohol(form.cmbAlcoholStatus().getValue());
    alcohol.setUnitsPerDay(form.intUnitsPerDay().getValue());
    alcohol.setDescriptiveHistory(form.txtTakenLastWeek().getValue());

    value.setAlcohol(alcohol);

    // Save Marital Status Info
    SocialHistoryMaritalStatusVo voMaritalStatus = new SocialHistoryMaritalStatusVo();
    voMaritalStatus.setMaritalStatus(form.cmbMaritalStat().getValue());

    voMaritalStatus.setStatusDate(form.pdtMaritalStatus().getValue());
    value.setMaritalStatus(voMaritalStatus);

    if(value.getIllicitDrugsList() == null)
        value.setIllicitDrugsList(new IllicitDrugsVo());

    value = populateDataFromIllicitDrugsGrid(value);
    value.getIllicitDrugsList().setDrugsUsedIntravenously(form.ansIVUser().getValue());

    //WDEV-12901 set Recording Information
    if(value.getRecordingInformation()==null){
        RecordingUserInformationVo voRecordingUserInformation = new RecordingUserInformationVo();
        voRecordingUserInformation.setRecordingUser(form.cmbRecordingHCP().getValue());
        voRecordingUserInformation.setRecordingDateTime(new DateTime());
        value.setRecordingInformation(voRecordingUserInformation);
    }

    return value;
}