Right now I am dealing constantly with documents encoded in this fashion, lots of them, and sometimes very large.
Things to consider: You make some comments about .NET before providing the java class. With the helper java class you may want to include a check that the size is divisible by 4, one of the few checks you can use to help figure out if the content is Base64. You may also want to wrap the decode in a try catch and throw a specific exception if it doesn’t decode. If you are really going for a pre-decode check, you could do a regex on the permitted characters (something I am hopeless at, and since it’s not guaranteed to help you confirm it is decodable, seldom worth the effort). Where you are building a message with datatype ED (encapsulated data) you will help anyone who receives the message if you fill out the other fields in the ED See this page: http://hl7-definition.caristix.com:9010/Default.aspx?version=HL7%20v2.5.1&dataType=ED From one of the senders I have received from, this looks like: MEDICALOBJECTS&MEDICALOBJECTS:3.1.7 (Build 45) [win32-i386]&L^AP^PDF^Base64^(Encoded PDF here) Since in my case I can receive different types of encapsulated data, and indication that it is a PDF not an RTF, JPG or other type is very helpful. Thanks again for such detailed examples Ian Vowles Integration Specialist Metro North Integration Centre Citilink Lobby 2, Level 3 153 Campbell St Bowen Hills QLD 4006 Ph: (07) 3646 2557 ian.vow...@health.qld.gov.au<mailto:ian.vow...@health.qld.gov.au> metronorth.health.qld.gov.au<https://metronorth.health.qld.gov.au/> [Values in Action] [Facebook]<http://www.facebook.com/metronorthhhs> [Twitter]<http://www.twitter.com/MetroNorthHHS> [LinkedIn]<http://www.linkedin.com/company/metro-north-hospital-and-health-service> follow us on social media From: Saravanan Subramanian [mailto:manfromreg...@outlook.com] Sent: Monday, 8 October 2018 1:14 PM To: HAPI Devel List <hl7api-devel@lists.sourceforge.net> Subject: [HAPI-devel] Article on Handling binary data transmission using Base-64 Encoding - Feedback Required Dear HAPI Community Wrote one more article recently on using HAPI toolkit to handle binary data in HL7 messages using Base64-encoding. Once again, any feedback/criticisms are much appreciated. This is an area of the toolkit that I had only recently explored. https://saravanansubramanian.com/hl72xhapiprocessbinarydata/ Thanks again to the contributors who shape it everyday! Have a great weekend! Saravanan ******************************************************************************** This email, including any attachments sent with it, is confidential and for the sole use of the intended recipient(s). This confidentiality is not waived or lost, if you receive it and you are not the intended recipient(s), or if it is transmitted/received in error. Any unauthorised use, alteration, disclosure, distribution or review of this email is strictly prohibited. The information contained in this email, including any attachment sent with it, may be subject to a statutory duty of confidentiality if it relates to health service matters. If you are not the intended recipient(s), or if you have received this email in error, you are asked to immediately notify the sender by telephone collect on Australia +61 1800 198 175 or by return email. You should also delete this email, and any copies, from your computer system network and destroy any hard copies produced. If not an intended recipient of this email, you must not copy, distribute or take any action(s) that relies on it; any form of disclosure, modification, distribution and/or publication of this email is also prohibited. Although Queensland Health takes all reasonable steps to ensure this email does not contain malicious software, Queensland Health does not accept responsibility for the consequences if any person's computer inadvertently suffers any disruption to services, loss of information, harm or is infected with a virus, other malicious computer programme or code that may occur as a consequence of receiving this email. Unless stated otherwise, this email represents only the views of the sender and not the views of the Queensland Government. **********************************************************************************
_______________________________________________ Hl7api-devel mailing list Hl7api-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/hl7api-devel