/*
* 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.report.ReportParam;
import cli_fmw.main.ClipsException;
import clips.delegate.client.ClientDocumentData;
import clips.delegate.client.ClientLocal;
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.TypeTextField;
import framework.utils.Converter;
/**
*
* @author lacoste
*/
@TagToClass(tagName="document_place_date",title="Место и дата выдачи")
public class CertTagPacientDocPlaceDate extends TypeTextField {
public CertTagPacientDocPlaceDate(CertificateLocal certificateLocal, ReportParam reportParam, DiseaseLocal diseaseLocal) throws ClipsException {
super(certificateLocal, reportParam, diseaseLocal);
if (certificateLocal.isNewlyCreated()) {
ClientLocal clientLocal = certificateLocal.getClientLocal();
ClientDocumentData doc = clientLocal.getClientDocument();
if (doc != null) {
String str = "";
if (doc.getGivenPlace() != null && doc.getGivenPlace().getID() != 0) {
str += doc.getGivenPlace().getTitle();
}
if (doc.getDate() != null) {
str += " " + Converter.dateToString(doc.getDate());
}
setText(str, true);
}
}
}
@Override
public boolean isEditable() {
return true;
}
}