Package clips.delegate.doctor.certificate.tag.certTags

Source Code of clips.delegate.doctor.certificate.tag.certTags.CertTagPacientCitizen

/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/

package clips.delegate.doctor.certificate.tag.certTags;

import clips.delegate.doctor.DiseaseLocal;
import clips.delegate.doctor.certificate.CertificateLocal;
import clips.delegate.doctor.certificate.tag.TagToClass;
import clips.delegate.doctor.certificate.tag.interfaces.TypeSelectableRO;
import cli_fmw.delegate.report.ReportParam;
import cli_fmw.main.ClipsException;
import framework.utils.PairIntStr;

/**
*
* @author vip
*/
@TagToClass(tagName="pacient_citizen", title="Городской/сельский житель")
public class CertTagPacientCitizen extends TypeSelectableRO {
    public static final int CITIZEN = 1;
    public static final int COUNTRYMAN = 2;

    public CertTagPacientCitizen() throws ClipsException {
    }

    public CertTagPacientCitizen(CertificateLocal certificateLocal, ReportParam reportParam, DiseaseLocal diseaseLocal) throws ClipsException {
        super(certificateLocal, reportParam, diseaseLocal);
        if (certificateLocal.isNewlyCreated()) {
            Boolean c = certificateLocal.getClientLocal().getAddress().isCitizen();
            if (c == null) {
                setItem(0);
            } else if (c) {
                setItem(CITIZEN);
            } else {
                setItem(COUNTRYMAN);
            }
        }
    }

    @Override
    public void fillItems() throws ClipsException {
        allItems.add(new PairIntStr(0, ""));
        allItems.add(new PairIntStr(CITIZEN, "городской"));
        allItems.add(new PairIntStr(COUNTRYMAN, "сельский"));
    }

}
TOP

Related Classes of clips.delegate.doctor.certificate.tag.certTags.CertTagPacientCitizen

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.