All Downloads are FREE. Search and download functionalities are using the official Maven repository.

br.ufsc.bridge.mpiclient.validator.EnderecoValidator Maven / Gradle / Ivy

Go to download

Implementação de client para um servidor MPI (Master Patient Index) utilizando mensagens SOAP (PIX/PDQ) baseadas na especificação técnica para integração do DATASUS.

The newest version!
package br.ufsc.bridge.mpiclient.validator;

import static br.ufsc.bridge.mpiclient.model.MEndereco.meta;

import br.ufsc.bridge.mpiclient.model.Endereco;
import br.ufsc.bridge.mpiclient.model.dominio.Pais;
import br.ufsc.bridge.platform.validation.form.errors.FormError;
import br.ufsc.bridge.platform.validation.rules.Rules;

public class EnderecoValidator {

	public void validate(Endereco endereco, FormError error) {
		if(Pais.BRASIL.equals(endereco.getPais())){

			error
					.check(meta.bairro, Rules.required)
					.check(meta.codigoMunicipio, Rules.required)
					.check(meta.logradouro, Rules.required)
					.check(meta.numero, Rules.required)
					.check(meta.pais, Rules.required)
					.check(meta.tipoLogradouro, Rules.required)
					.check(meta.uf, Rules.required);
		}else{
			error
					.check(meta.codigoMunicipio, Rules.required)
					.check(meta.pais, Rules.required);
		}
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy