ClientLocal representative = null;
if (client.getPolisOMS().getNumber().equals(Polis.FICTIVE_POLIS_NUMBER)) {
representative = client.getRepresentative();
}
ClientDocumentData doc;
PolisData polis;
if (representative != null) {
data.put("representative_surname", representative.getSurname().getTitle());
data.put("representative_name", representative.getName().getTitle());
data.put("representative_patron", representative.getPathron().getTitle());
data.put("is_representative_document", Boolean.TRUE);
DirectoryRepresentativeStatusItem item = client.getRepresStatus();
if (item != null) {
data.put("representative_status", item.getID());
}
doc = representative.getClientDocument();
polis = representative.getPolisOMS();
}
else {
doc = client.getClientDocument();
polis = client.getPolisOMS();
}
if (doc != null) {
data.put("pacient_document_title", doc.getType().getTitle());
String docS = doc.getSeries();
if (docS != null) {
data.put("pacient_document_series", docS);
}
docS = doc.getNumber();
if (docS != null) {
data.put("pacient_document_number", docS);
}
}