diff --git a/src/main/java/org/openhim/mediator/orchestration/ProvideAndRegisterOrchestrationActor.java b/src/main/java/org/openhim/mediator/orchestration/ProvideAndRegisterOrchestrationActor.java index 543bfa2..900c726 100644 --- a/src/main/java/org/openhim/mediator/orchestration/ProvideAndRegisterOrchestrationActor.java +++ b/src/main/java/org/openhim/mediator/orchestration/ProvideAndRegisterOrchestrationActor.java @@ -31,6 +31,7 @@ import org.xml.sax.SAXException; import org.xml.sax.SAXParseException; +import javax.xml.bind.DatatypeConverter; import javax.xml.bind.JAXBException; import javax.xml.parsers.DocumentBuilder; import javax.xml.parsers.DocumentBuilderFactory; @@ -461,7 +462,8 @@ private void autoRegisterPatient() { String document = originalRequest.getDocument(); //is mime? if (document == null) { //else get from parsed message if (parsedRequest.getDocument()!=null && parsedRequest.getDocument().size()>=1) { - document = new String(parsedRequest.getDocument().get(0).getValue()); + document = parsedRequest.getDocument().get(0).getContent().get(0).toString(); + document = new String(DatatypeConverter.parseBase64Binary(document)); } } diff --git a/src/main/resources/schema/IHE/XDS.b_DocumentRepository.xsd b/src/main/resources/schema/IHE/XDS.b_DocumentRepository.xsd index 012060c..98f7f7d 100644 --- a/src/main/resources/schema/IHE/XDS.b_DocumentRepository.xsd +++ b/src/main/resources/schema/IHE/XDS.b_DocumentRepository.xsd @@ -75,17 +75,16 @@ - - - - - - - This corresponds to the ExtrinsicObject id in the eb RIM metadata a provides a linkage between the actual document data and its metadata - - - - + + + + + + + + This corresponds to the ExtrinsicObject id in the eb RIM metadata a provides a linkage between the actual document data and its metadata + + diff --git a/src/test/resources/mock-services/smart-pix-server.js b/src/test/resources/mock-services/smart-pix-server.js index 96c115e..e5e6fdc 100755 --- a/src/test/resources/mock-services/smart-pix-server.js +++ b/src/test/resources/mock-services/smart-pix-server.js @@ -37,15 +37,15 @@ net.createServer(function(c) { data += chunk; if (chunk.toString().indexOf(footer) != -1) { - console.log('Recieved message:\n' + data.replace('\r', '\n') + '\n\n'); + console.log('Recieved message:\n' + data.replace(/\r/g, '\n') + '\n\n'); var regex = /(PID|QPD)\|[\w\s]*\|[\w\s\-\.]*\|([\w\.\^\&\~]+)/g; var pids = regex.exec(data)[2].split('~'); var _i, _len; for (_i = 0, _len = pids.length; _i < _len; _i++) { - if (pids[_i].indexOf('ISO') > -1) { - pids[_i] = pids[_i].substr(0, pids[_i].indexOf('ISO')); + if (pids[_i].indexOf('&') > -1) { + pids[_i] = pids[_i].substr(0, pids[_i].indexOf('&')); } } console.log("PID: " + pids);