Scott Roth
Sr Applications Development Analyst
The Ohio State University Wexner Medical Center
Here is a COS routine used to validate PDF files embedded in HL7…
W "Not implemented",!
Q
Check //Here is where it starts
Read "Message Id: ",mid
w !
q:mid=""
s message=##class(EnsLib.HL7.Message).%OpenId(mid)
Q:'$ISOBJECt(message)
R "Field: //ORCgrp(1).OBRgrp(2).OBXgrp(1).OBX:5(1).5? ",field
s:field="" field="ORCgrp(1).OBRgrp(2).OBXgrp(1).OBX:5(1).5"
s pdfStream=##class(%Stream.TmpBinary).%New()
s file=##class(%FileBinaryStream).%New()
s remainder=""
//s tSC=message.GetFieldStreamBase64(pdfStream,field,remainder,0)
set tSC=message.GetMutableSegmentAt("ORCgrp(1).OBRgrp(2).OBXgrp(1).OBX").GetFieldStreamRaw(pdfStream,"5.5")
w "Size of file: ",pdfStream.Size,!
Q:pdfStream.Size=0
w "Remainder: ",remainder,!
Q:'$ISOBJECT(pdfStream)
d pdfStream.Rewind()
W "File will be written to the h:\Temp\PDF_Validate folder on the Ensemble server",!
Read "FileName: ",filename
if filename="" w !,"no
filename given... not writing file...",!
Q
W !
set file.Filename="h:\Temp\PDF_Validate\"_filename
set tSC=file.Rewind()
d pdfStream.Rewind()
While 'pdfStream.AtEnd {
//set tSC = file.Write(pdfStream.ReadLine())
set tSC =
file.Write($system.Encryption.Base64Decode(pdfStream.ReadLine()))
}
s tSC =
file.%Save()
s file =
""
--
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare Community" group.
To post to this group, send email to
Ensemble-in...@googlegroups.com
To unsubscribe from this group, send email to
Ensemble-in-Healt...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/Ensemble-in-Healthcare?hl=en
---
You received this message because you are subscribed to the Google Groups "InterSystems: Ensemble in Healthcare" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
Ensemble-in-Healt...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.