HDISVS04 ;BPFO/JRP - PROCESS UUENCODED MESSAGE FOR LAB EXCEPTIONS;6/26/2007
;;1.0;HEALTH DATA & INFORMATICS;**7**;Feb 22, 2005;Build 33
;
LABXCPT(MSGARR,ERRARR) ;Main entry point for Lab exception messages
; Input : MSGARR - Array containing received message (closed root)
; @MSGARR@(1..n,0) = Message text
; ERRARR - Array to output errors in (closed root)
;Output : None
; @ERRARR@(x) = Error text (if applicable)
; Notes : ERRARR is initialized (KILLed) on input
;
NEW DECARR,FILENAME,PATH
SET DECARR=$NAME(^TMP("HDISVS04",$JOB,"DECARR"))
KILL @DECARR
;UUDecode attachment in received message
DO DECODE^HDISVM04(MSGARR,DECARR,1,1)
;Nothing decoded
IF ('$DATA(@DECARR)) DO QUIT
.SET @ERRARR@(1)="Unable to find attachment to UUDecode"
.KILL @DECARR
.QUIT
;Remember filename of attachment and remove from decoded array
SET FILENAME=$GET(@DECARR@(0))
KILL @DECARR@(0)
;Save file to disk - hard coded as FORUM's Anonymous directory
SET PATH="USER$:[ANONYMOUS]"
IF ('$$GTF^%ZISH(DECARR,($QLENGTH(DECARR)+1),PATH,FILENAME)) DO QUIT
.SET @ERRARR@(1)="Unable to store attached document to disk ("_PATH_")"
.KILL @DECARR
.QUIT
;Done
KILL @DECARR
QUIT
;
; === Code from here down was used when the received
; === data was a delimitted text file that was broken
; === down into a "grid" for hand-off to interface to
; === HWSC. Left for reference purposes. Removed
; === NEWing and instantiation of GRIDARR variable.
;
; Break up into individual columns
; SET ROW=0
; FOR SET ROW=+$ORDER(@DECARR@(ROW)) QUIT:('ROW) DO
; .DO PARSE^HDISVM05($NAME(@DECARR@(ROW)),$NAME(@GRIDARR@(ROW)),"|",1,245)
; .QUIT
; ;Done
; KILL @DECARR,@GRIDARR
; QUIT
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HHDISVS04 1766 printed Oct 16, 2024@17:57:53 Page 2
HDISVS04 ;BPFO/JRP - PROCESS UUENCODED MESSAGE FOR LAB EXCEPTIONS;6/26/2007
+1 ;;1.0;HEALTH DATA & INFORMATICS;**7**;Feb 22, 2005;Build 33
+2 ;
LABXCPT(MSGARR,ERRARR) ;Main entry point for Lab exception messages
+1 ; Input : MSGARR - Array containing received message (closed root)
+2 ; @MSGARR@(1..n,0) = Message text
+3 ; ERRARR - Array to output errors in (closed root)
+4 ;Output : None
+5 ; @ERRARR@(x) = Error text (if applicable)
+6 ; Notes : ERRARR is initialized (KILLed) on input
+7 ;
+8 NEW DECARR,FILENAME,PATH
+9 SET DECARR=$NAME(^TMP("HDISVS04",$JOB,"DECARR"))
+10 KILL @DECARR
+11 ;UUDecode attachment in received message
+12 DO DECODE^HDISVM04(MSGARR,DECARR,1,1)
+13 ;Nothing decoded
+14 IF ('$DATA(@DECARR))
Begin DoDot:1
+15 SET @ERRARR@(1)="Unable to find attachment to UUDecode"
+16 KILL @DECARR
+17 QUIT
End DoDot:1
QUIT
+18 ;Remember filename of attachment and remove from decoded array
+19 SET FILENAME=$GET(@DECARR@(0))
+20 KILL @DECARR@(0)
+21 ;Save file to disk - hard coded as FORUM's Anonymous directory
+22 SET PATH="USER$:[ANONYMOUS]"
+23 IF ('$$GTF^%ZISH(DECARR,($QLENGTH(DECARR)+1),PATH,FILENAME))
Begin DoDot:1
+24 SET @ERRARR@(1)="Unable to store attached document to disk ("_PATH_")"
+25 KILL @DECARR
+26 QUIT
End DoDot:1
QUIT
+27 ;Done
+28 KILL @DECARR
+29 QUIT
+30 ;
+31 ; === Code from here down was used when the received
+32 ; === data was a delimitted text file that was broken
+33 ; === down into a "grid" for hand-off to interface to
+34 ; === HWSC. Left for reference purposes. Removed
+35 ; === NEWing and instantiation of GRIDARR variable.
+36 ;
+37 ; Break up into individual columns
+38 ; SET ROW=0
+39 ; FOR SET ROW=+$ORDER(@DECARR@(ROW)) QUIT:('ROW) DO
+40 ; .DO PARSE^HDISVM05($NAME(@DECARR@(ROW)),$NAME(@GRIDARR@(ROW)),"|",1,245)
+41 ; .QUIT
+42 ; ;Done
+43 ; KILL @DECARR,@GRIDARR
+44 ; QUIT