public void close() {
conn.close(sock);
}
public void query(String pid, String[] domains) throws IOException {
HL7Message qbp = HL7Message.makePixQuery(pid, domains);
HL7Segment msh = qbp.get(0);
msh.setSendingApplicationWithFacility(sendingApplication);
msh.setReceivingApplicationWithFacility(receivingApplication);
msh.setField(17, charset);
mllp.writeMessage(qbp.getBytes(charset));
if (mllp.readMessage() == null)
throw new IOException("Connection closed by receiver");
}