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

br.ufsc.bridge.mpiclient.responsehandler.pdq.DocumentHandler 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.responsehandler.pdq;

import java.util.Arrays;
import java.util.List;

import lombok.NonNull;

import org.xml.sax.Attributes;
import org.xml.sax.SAXException;

import br.ufsc.bridge.mpiclient.model.Cidadao;
import br.ufsc.bridge.mpiclient.responsehandler.DefaultAttributeHandler;

public class DocumentHandler extends DefaultAttributeHandler {

	private List oidsDocument;

	public DocumentHandler(@NonNull String... oidDocument) {
		super("asOtherIDs");
		this.oidsDocument = Arrays.asList(oidDocument);
		this.handlers.add(new IgnoreAttribute("scopingOrganization"));
	}

	@Override
	protected void returnToParent(String uri, String localName, String qName) throws SAXException {
		super.returnToParent(uri, localName, qName);
		this.parent.endElement(uri, localName, qName);
	}

	@Override
	public boolean accept(String localName, Attributes attr) {
		return "id".equals(localName) && this.oidsDocument.contains(attr.getValue("root"));
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy