Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds encoding functionality to support languages with accent letters e.g. Portuguese #38

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,8 @@ private MSH populateMessageHeader(MSH msh, Date dateTime, String messageType, St
// TODO: do we need to send Message Control ID?
msh.getProcessingID().getProcessingID().setValue("P"); // stands for production (?)
msh.getVersionID().getVersionID().setValue("2.5");
// Supported dcm4che encoding for accent letters
msh.getCharacterSet(0).setValue("8859/1");
return msh;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import ca.uhn.hl7v2.app.Connection;
import ca.uhn.hl7v2.app.Initiator;
import ca.uhn.hl7v2.llp.LLPException;
import ca.uhn.hl7v2.llp.MinLowerLayerProtocol;
import ca.uhn.hl7v2.model.AbstractMessage;
import ca.uhn.hl7v2.model.Message;
import ca.uhn.hl7v2.model.v25.message.*;
Expand Down Expand Up @@ -49,6 +50,7 @@ Message post(Modality modality, Message requestMessage) throws LLPException, IOE
Connection newClientConnection = null;
try {
HapiContext hapiContext = new DefaultHapiContext();
hapiContext.setLowerLayerProtocol(new MinLowerLayerProtocol(true));
newClientConnection = hapiContext.newClient(modality.getIp(), modality.getPort(), false);
Initiator initiator = newClientConnection.getInitiator();
return initiator.sendAndReceive(requestMessage);
Expand Down