Java 类ims.core.vo.lookups.PrivateInsurancePolicyType 实例源码

项目:openMAXIMS    文件:Logic.java   
private void updateControlsState() 
{
    form.ctnDetails().lblOther().setVisible(PrivateInsurancePolicyType.OTHER.equals(form.ctnDetails().cmbPolicyType().getValue()));
    form.ctnDetails().txtOther().setEnabled(FormMode.EDIT.equals(form.getMode()));
    form.ctnDetails().txtOther().setVisible(PrivateInsurancePolicyType.OTHER.equals(form.ctnDetails().cmbPolicyType().getValue()));

    // Update controls for VIEW mode
    if (FormMode.VIEW.equals(form.getMode()))
    {
        // EDIT button
        form.btnUpdate().setEnabled(true);
        form.btnUpdate().setVisible(form.grdInsurance().getValue() instanceof PatientMedicalInsuranceVo);
    }

    form.ctnDetails().setCollapsed(!(form.grdInsurance().getValue() != null || FormMode.EDIT.equals(form.getMode())));

    // Update context menu options
    updateContextMenuState();   
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbPolicyTypeValueChanged() throws PresentationLogicException
{
    PrivateInsurancePolicyType type = form.lyrDetails().tabOtherDetails().cmbPolicyType().getValue();

    form.lyrDetails().tabOtherDetails().txtPolicyOther().setRequired(PrivateInsurancePolicyType.OTHER.equals(type));
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbPolicyTypeValueChanged() throws PresentationLogicException
{
    if (!PrivateInsurancePolicyType.OTHER.equals(form.cmbPolicyType().getValue()))
        form.txtOther().setValue(null);

    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
private void updateControlsState()
{
    form.txtMedicalCardNo().setEnabled(FormMode.EDIT.equals(form.getMode()));
    form.pdtExpiryDate().setEnabled(FormMode.EDIT.equals(form.getMode()));
    form.cmbElegibility().setEnabled(FormMode.EDIT.equals(form.getMode()));
    form.cmbProved().setEnabled(FormMode.EDIT.equals(form.getMode()));
    form.txtEligibilityProof().setEnabled(FormMode.EDIT.equals(form.getMode()));

    form.txtOther().setEnabled(FormMode.EDIT.equals(form.getMode()));
    form.txtOther().setVisible(PrivateInsurancePolicyType.OTHER.equals(form.cmbPolicyType().getValue()));
    form.lblOther().setVisible(PrivateInsurancePolicyType.OTHER.equals(form.cmbPolicyType().getValue()));
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbPolicyTypeValueChanged() throws PresentationLogicException
{
    if (!PrivateInsurancePolicyType.OTHER.equals(form.ctnDetails().cmbPolicyType().getValue()))
        form.ctnDetails().txtOther().setValue(null);

    updateControlsState();
}
项目:openMAXIMS    文件:Logic.java   
private String[] validateUIRules()
{
    ArrayList<String> listOfErrors = new ArrayList<String>();
    if( form.ctnDetails().cmbCompany().getValue() == null )     //wdev-19528
    {
        listOfErrors.add("Insurer is mandatory.");
    }

    if (PrivateInsurancePolicyType.OTHER.equals(form.ctnDetails().cmbPolicyType().getValue()) && form.ctnDetails().txtOther().getValue() == null)
    {
        listOfErrors.add("Other policy type is mandatory.");
    }

    return listOfErrors.toArray(new String[listOfErrors.size()]);
}
项目:openMAXIMS    文件:Logic.java   
@Override
protected void onCmbPolicyTypeValueChanged() throws PresentationLogicException
{
    if (!PrivateInsurancePolicyType.OTHER.equals(form.cmbPolicyType().getValue()))
        form.txtOther().setValue(null);

    updateControlState();
}
项目:openMAXIMS    文件:A28VoMapper.java   
protected void renderPatientMedicalInsuranceToIN1(PatientMedicalInsuranceVo medicalInsurance,IN1 in1,ProviderSystemVo providerSystem) throws HL7Exception
{
    if(medicalInsurance==null||in1==null||providerSystem==null)
    {
        return;
    }
    //IN1-3
    if(medicalInsurance.getCompanyIsNotNull()&&medicalInsurance.getCompany().getCodeMappingsIsNotNull())
    {
        String companyName  = medicalInsurance.getCompany().getCodeMappings().getMappingValue(providerSystem.getCodeSystem());
        in1.getInsuranceCompanyID(0).getID().setValue(companyName);
    }
    //IN1-36
    if(medicalInsurance.getPolicyNumberIsNotNull())
    {
        in1.getPolicyNumber().setValue(medicalInsurance.getPolicyNumber());
    }
    //IN1-2
    if(medicalInsurance.getPolicyTypeIsNotNull()&&!(medicalInsurance.getPolicyType().getID()==(PrivateInsurancePolicyType.OTHER.getID())))
    {
        in1.getInsurancePlanID().getIdentifier().setValue(svc.getRemoteLookup(medicalInsurance.getPolicyType().getID(), providerSystem.getCodeSystem().getText()));
    }
    else if(medicalInsurance.getPlanOrUnitsIsNotNull())
    {
        in1.getInsurancePlanID().getIdentifier().setValue(medicalInsurance.getPlanOrUnits());
    }
    //IN1-13
    if(medicalInsurance.getExpiryDateIsNotNull())
    {
        in1.getPlanExpirationDate().setValue(medicalInsurance.getExpiryDate().toString(DateFormat.ISO));
    }

}
项目:openMAXIMS    文件:Logic.java   
private void populateInsuranceFromData(NationalHealthCoverVo insurance, PatientMedicalInsuranceVo patientmedicalinsurance)
{
    if( patientmedicalinsurance != null )
    {
        if( patientmedicalinsurance.getCompanyIsNotNull())
        {
            if( form.lyrDetails().tabOtherDetails().cmbInsurer().getValues().contains(patientmedicalinsurance.getCompany()))
                form.lyrDetails().tabOtherDetails().cmbInsurer().setValue(patientmedicalinsurance.getCompany());
            else
            {
                form.lyrDetails().tabOtherDetails().cmbInsurer().newRow(patientmedicalinsurance.getCompany(), patientmedicalinsurance.getCompany().getIItemText());
                form.lyrDetails().tabOtherDetails().cmbInsurer().setValue(patientmedicalinsurance.getCompany());
            }
        }
        form.lyrDetails().tabOtherDetails().txtPolicyNumber().setValue(patientmedicalinsurance.getPolicyNumber());
        form.lyrDetails().tabOtherDetails().cmbPolicyType().setValue(patientmedicalinsurance.getPolicyType());
        form.lyrDetails().tabOtherDetails().txtPolicyOther().setValue(patientmedicalinsurance.getPlanOrUnits());
        form.lyrDetails().tabOtherDetails().dteRenewalDate().setValue(patientmedicalinsurance.getExpiryDate());

        PrivateInsurancePolicyType type = form.lyrDetails().tabOtherDetails().cmbPolicyType().getValue();
        form.lyrDetails().tabOtherDetails().txtPolicyOther().setRequired(PrivateInsurancePolicyType.OTHER.equals(type));
    }

    form.lyrDetails().tabOtherDetails().cmbEligibilitySVUH().setVisible(isSVUH());
    form.lyrDetails().tabOtherDetails().lblEligibility().setVisible(isSVUH());

    if(form.lyrDetails().tabOtherDetails().cmbEligibilitySVUH().getVisible())
        form.lyrDetails().tabOtherDetails().cmbEligibilitySVUH().setRequired(true);

    //WDEV-23335
    form.lyrDetails().tabOtherDetails().cmbEligibility().setVisible(!isSVUH());
    form.lyrDetails().tabOtherDetails().lblEligibility1().setVisible(!isSVUH());
    form.lyrDetails().tabOtherDetails().lblEligibility2().setVisible(!isSVUH());

    if( insurance != null )
    {
        form.lyrDetails().tabOtherDetails().txtEhicNumber().setValue(insurance.getEHICNumber());
        form.lyrDetails().tabOtherDetails().pdtEhicExpiryDate().setValue(insurance.getEHICExpiryDate());
        form.lyrDetails().tabOtherDetails().cmbEhicCountry().setValue(insurance.getEHICCountry());
        form.lyrDetails().tabOtherDetails().cmbEhicInstitution().setValue(insurance.getEHICInstitutionCode());

        form.lyrDetails().tabOtherDetails().txtMedicalCardNo().setValue(insurance.getMedicalCardNo());
        form.lyrDetails().tabOtherDetails().pdtExpiryDate().setValue(insurance.getMedicalCardExpiryDate());
        form.lyrDetails().tabOtherDetails().cmbEligibility().setValue(insurance.getHealthActCategory());
        form.lyrDetails().tabOtherDetails().cmbProved().setValue(insurance.getMedicalCardProved());
        form.lyrDetails().tabOtherDetails().txtEligibilityProof().setValue(insurance.getEligibilityProof());

        if(form.lyrDetails().tabOtherDetails().cmbEligibilitySVUH().getVisible())
        {
            form.lyrDetails().tabOtherDetails().cmbEligibilitySVUH().setValue(insurance.getEligibility());
            try
            {
                onCmbEligibilitySVUHValueChanged();
            }
            catch (PresentationLogicException e)
            {
                e.printStackTrace();
            }
        }

    }

}
项目:openMAXIMS    文件:Logic.java   
public Boolean validateInsuranceDetails(java.util.ArrayList<String> errors)
{
    ArrayList<String> localErrors = new ArrayList<String>();

    if (PrivateInsurancePolicyType.OTHER.equals(form.lyrDetails().tabOtherDetails().cmbPolicyType().getValue()) && form.lyrDetails().tabOtherDetails().txtPolicyOther().getValue() == null)
    {
        localErrors.add("Other policy type is mandatory.");
    }

    //WDEV-22415
    if(form.lyrDetails().tabOtherDetails().txtEhicNumber().getValue()!=null && form.lyrDetails().tabOtherDetails().txtEhicNumber().getValue().length() > 20)
    {
        localErrors.add("The length of the field EHIC Number is too big. It should be less or equal to 20.");
    }
    //WDEV-22415 ends here

    if( localErrors.size() > 0)
    {
        String[] UIErrors = new String[localErrors.size()];
        localErrors.toArray(UIErrors);

        if(UIErrors != null)
        {
            if(errors != null)
            {
                for(String err: UIErrors)
                {
                    errors.add(err);
                }
            }
            else
            {
                engine.showErrors(UIErrors);
            }

            return false;
        }
    }

    return true;
}
项目:openMAXIMS    文件:Logic.java   
public Boolean validateInsuranceDetails()
{
    ArrayList<String> errors = new ArrayList<String>();

    if (PrivateInsurancePolicyType.OTHER.equals(form.cmbPolicyType().getValue()) && form.txtOther().getValue() == null)
    {
        errors.add("Other policy type is mandatory.");
    }


    if( !form.getLocalContext().getInsuranceVoIsNotNull() )
    {
        if( form.pdtEHICExpiryDate().getValue() != null && form.pdtEHICExpiryDate().getValue().isLessThan(new Date()))
        {
            errors.add("EHIC Expiry Date cannot be in the past!");
        }
        if( form.pdtExpiryDate().getValue() != null && form.pdtExpiryDate().getValue().isLessThan(new Date()))
        {
            errors.add("Expiry Date cannot be in the past!");
        }
    }
    else
    {
        if( form.pdtEHICExpiryDate().getValue() != null && !form.pdtEHICExpiryDate().getValue().equals(form.getLocalContext().getInsuranceVo().getEHICExpiryDate()) && form.pdtEHICExpiryDate().getValue().isLessThan(new Date()))
        {
            errors.add("EHIC Expiry Date cannot be in the past!");
        }
        if( form.pdtExpiryDate().getValue() != null && form.pdtExpiryDate().getValue().equals(form.getLocalContext().getInsuranceVo().getMedicalCardExpiryDate()) && form.pdtExpiryDate().getValue().isLessThan(new Date()))
        {
            errors.add("Expiry Date cannot be in the past!");
        }
    }


    if( errors.size() > 0)
    {
        String[] UIErrors = new String[errors.size()];
        errors.toArray(UIErrors);
        engine.showErrors(UIErrors);
        return false;
    }

    return true;
}