/*
* To change this template, choose Tools | Templates
* and open the template in the editor.
*/
package clips.delegate.doctor.certificate.tag.certTags;
import cli_fmw.delegate.directory.DirectoryItem;
import clips.delegate.doctor.DiseaseLocal;
import clips.delegate.doctor.certificate.CertificateLocal;
import clips.delegate.doctor.certificate.tag.TagToClass;
import cli_fmw.delegate.report.ReportParam;
import cli_fmw.main.ClipsException;
import clips.delegate.config.ConfigLocal;
import clips.delegate.doctor.certificate.tag.interfaces.TypeSelectableEdit;
import clips.login.UserInfo;
import framework.utils.PairIntStr;
import java.util.HashSet;
/**
*
* @author vip
*/
@TagToClass(tagName="pacient_category", title="категория больного (местный/бомж/иностранец)")
public class CertTagPacientCategory extends TypeSelectableEdit {
public static final int THIS_SUBJECT = 1;
public static final int OTHER_SUBJECT = 2;
public static final int SNG = 3;
public static final int HOMELESS = 4;
public static final int UIN = 5;
public static final int SIZO = 6;
public static final int OTHER_VEDOM = 7;
public static final int FOREIGNER = 8;
public static final int SOCIAL = 9;
public static final int OTHER = 10;
public CertTagPacientCategory() throws ClipsException {
}
public CertTagPacientCategory(CertificateLocal certificateLocal, ReportParam reportParam, DiseaseLocal diseaseLocal) throws ClipsException {
super(certificateLocal, reportParam, diseaseLocal);
if (certificateLocal.isNewlyCreated()) {
DirectoryItem clientRegion = certificateLocal.getClientLocal().getAddress().getRegion();
DirectoryItem hospitalRegion = UserInfo.get().getCollaborator().getLpu().getAddress().getRegion();
if (clientRegion != null) {
if (clientRegion.equals(hospitalRegion)){
setItem(THIS_SUBJECT);
} else {
setItem(OTHER_SUBJECT);
}
} else {
setItem(0);
}
}
}
@Override
public void fillItems() throws ClipsException {
allItems.add(new PairIntStr(0, ""));
allItems.add(new PairIntStr(THIS_SUBJECT, "житель данного субъекта РФ"));
allItems.add(new PairIntStr(OTHER_SUBJECT, "житель другого субъекта РФ"));
allItems.add(new PairIntStr(SNG, "СНГ (иммигрант)"));
allItems.add(new PairIntStr(HOMELESS, "БОМЖ"));
allItems.add(new PairIntStr(UIN, "контингент УИН"));
allItems.add(new PairIntStr(SIZO, "СИЗО"));
allItems.add(new PairIntStr(OTHER_VEDOM, "других ведомств (указать какое)"));
allItems.add(new PairIntStr(FOREIGNER, "иностранный гражданин"));
allItems.add(new PairIntStr(SOCIAL, "находится в учреждении соцзащиты"));
allItems.add(new PairIntStr(OTHER, "другое"));
editableItems = new HashSet<Integer>();
editableItems.add(OTHER_VEDOM);
editableItems.add(FOREIGNER);
editableItems.add(OTHER);
}
}