TIUFIX2 ; SLC/JER,MAM - Resolve Upload Filing Errors Library Two ;05/06/02
;;1.0;TEXT INTEGRATION UTILITIES;**131**;Jun 20, 1997
;
BUFFER(TIUEVNT) ; Return 8925.2 Upload Buffer IEN
; Gets Buffer for UNRESOLVED upload errors. (Returns error msg
;for resolved filing errors, where buffer is 0.)
; Requires [TIUEVNT] - Upload Log Event IEN (8925.4)
N TIUBUF
I '$D(^TIU(8925.4,TIUEVNT,0)) S TIUBUF="0^Invalid Upload Log event." G BUFX
S TIUBUF=+$P($G(^TIU(8925.4,TIUEVNT,0)),U,5)
I TIUBUF'>0 S TIUBUF="0^Upload Buffer record is missing from Upload Log event." G BUFX
I '$D(^TIU(8925.2,TIUBUF,0)) S TIUBUF="0^Upload Log event references an invalid Upload Buffer record."
BUFX Q TIUBUF
;
LOADHDR(TIUARR,TIUBUF,TIUPRM0,TIUTYPE) ; Load array with header data
;from upload buffer
; Requires [TIUARR] - Array of header data. Loaded and passed back
; [TIUBUF] - 8925.2 Upload Buffer IEN
; [TIUPRM0] - Header signal, etc. See SETPARM^TIULE
; [TIUTYPE] - IEN of Docmt Def whose Filing Error
; Resolution Code is being invoked
;NOTE: LOADHDR does NOT kill ANY nodes of TIUARR.
; (LOADTIUX^TIUPEFIX does kill certain nodes.)
; See warning in MAKE^TIUFIX1 concerning possible
; need to kill nodes of array.
N TIUI,TIUHSIG,TIUBGN,TIULINE
S TIUHSIG=$P(TIUPRM0,U,10),TIUBGN=$P(TIUPRM0,U,12)
S TIUI=0 F S TIUI=$O(^TIU(8925.2,+TIUBUF,"TEXT",TIUI)) Q:+TIUI'>0 D
. S TIULINE=$G(^TIU(8925.2,+TIUBUF,"TEXT",TIUI,0))
. I TIULINE[TIUHSIG D
. . F D Q:TIULINE[TIUBGN!(+TIUI'>0)
. . . N TIUN,TIUCAP,TIUFLD,TIUREQ S TIUREQ=0
. . . S TIUI=$O(^TIU(8925.2,+TIUBUF,"TEXT",TIUI)) Q:+TIUI'>0
. . . S TIULINE=$G(^TIU(8925.2,+TIUBUF,"TEXT",TIUI,0)) Q:TIULINE[TIUBGN
. . . S TIUCAP=$P(TIULINE,":") Q:TIUCAP']""
. . . ; -- Get upload header definition data for transcribed
. . . ; caption:
. . . S TIUN=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP,0))
. . . Q:+TIUN'>0
. . . S TIUFLD=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,3)
. . . ; -- Ignore caption if hdr def does not associate a
. . . ; field number with it:
. . . Q:TIUFLD']""
. . . S TIUREQ=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,7)
. . . S TIUARR(TIUFLD)=$$STRIP^TIULS($P(TIULINE,":",2,99))
. . . S TIUARR(TIUFLD)=$$TRNSFRM(TIUTYPE,TIUFLD,TIUARR(TIUFLD))
. . . ; -- If caption has no data, and hdr def requires data,
. . . ; set node to create missing field msg in FILE^TIUFIX1.
. . . ; For most fields, "** REQUIRED FIELD MISSING FROM
. . . ; UPLOAD**" will be invalid data and will not file.
. . . ; If field is free text so that it does file, at
. . . ; least it's intelligible.
. . . I +TIUREQ,TIUARR(TIUFLD)="" S TIUARR(TIUFLD)="** REQUIRED FIELD MISSING FROM UPLOAD **"
; -- Leave missing captions fix til later; TIUPUTC1?? needs
; same change 4/21/02:
; -- Set nodes for any captions required in upload hdr
; def but missing from buffer. Check only captions that
; do NOT have Lookup variables, since that info is supplied
; by user and is not a missing field. Even if set here,
; message will be created only for nodes not killed before
; filing.
;N TIUCAP,TIUREQ,TIUFLD,LOOKV
;S TIUCAP=""
;S TIUCAP=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP)) Q:TIUCAP="" D
;. S TIUN=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP,0))
;. S TIUREQ=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,7)
;. Q:'TIUREQ
;. S TIUFLD=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,3)
;. Q:'TIUFLD
;. S LOOKV=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,4)
;. Q:LOOKV]""
;. I '$D(TIUARR(TIUFLD)) S TIUARR(TIUFLD)="** REQUIRED CAPTION MISSING FROM UPLOAD **"
Q
TRNSFRM(RTYPE,FLD,X) ; Executes Transform code for a given header field
N XFORM
S FLD=$O(^TIU(8925.1,+RTYPE,"HEAD","D",+FLD,0))
I +FLD'>0 G TRNSFRMX
S XFORM=$G(^TIU(8925.1,+RTYPE,"HEAD",+FLD,1))
I XFORM']"" G TRNSFRMX
X XFORM
TRNSFRMX Q X
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HTIUFIX2 3939 printed Dec 13, 2024@02:40:56 Page 2
TIUFIX2 ; SLC/JER,MAM - Resolve Upload Filing Errors Library Two ;05/06/02
+1 ;;1.0;TEXT INTEGRATION UTILITIES;**131**;Jun 20, 1997
+2 ;
BUFFER(TIUEVNT) ; Return 8925.2 Upload Buffer IEN
+1 ; Gets Buffer for UNRESOLVED upload errors. (Returns error msg
+2 ;for resolved filing errors, where buffer is 0.)
+3 ; Requires [TIUEVNT] - Upload Log Event IEN (8925.4)
+4 NEW TIUBUF
+5 IF '$DATA(^TIU(8925.4,TIUEVNT,0))
SET TIUBUF="0^Invalid Upload Log event."
GOTO BUFX
+6 SET TIUBUF=+$PIECE($GET(^TIU(8925.4,TIUEVNT,0)),U,5)
+7 IF TIUBUF'>0
SET TIUBUF="0^Upload Buffer record is missing from Upload Log event."
GOTO BUFX
+8 IF '$DATA(^TIU(8925.2,TIUBUF,0))
SET TIUBUF="0^Upload Log event references an invalid Upload Buffer record."
BUFX QUIT TIUBUF
+1 ;
LOADHDR(TIUARR,TIUBUF,TIUPRM0,TIUTYPE) ; Load array with header data
+1 ;from upload buffer
+2 ; Requires [TIUARR] - Array of header data. Loaded and passed back
+3 ; [TIUBUF] - 8925.2 Upload Buffer IEN
+4 ; [TIUPRM0] - Header signal, etc. See SETPARM^TIULE
+5 ; [TIUTYPE] - IEN of Docmt Def whose Filing Error
+6 ; Resolution Code is being invoked
+7 ;NOTE: LOADHDR does NOT kill ANY nodes of TIUARR.
+8 ; (LOADTIUX^TIUPEFIX does kill certain nodes.)
+9 ; See warning in MAKE^TIUFIX1 concerning possible
+10 ; need to kill nodes of array.
+11 NEW TIUI,TIUHSIG,TIUBGN,TIULINE
+12 SET TIUHSIG=$PIECE(TIUPRM0,U,10)
SET TIUBGN=$PIECE(TIUPRM0,U,12)
+13 SET TIUI=0
FOR
SET TIUI=$ORDER(^TIU(8925.2,+TIUBUF,"TEXT",TIUI))
if +TIUI'>0
QUIT
Begin DoDot:1
+14 SET TIULINE=$GET(^TIU(8925.2,+TIUBUF,"TEXT",TIUI,0))
+15 IF TIULINE[TIUHSIG
Begin DoDot:2
+16 FOR
Begin DoDot:3
+17 NEW TIUN,TIUCAP,TIUFLD,TIUREQ
SET TIUREQ=0
+18 SET TIUI=$ORDER(^TIU(8925.2,+TIUBUF,"TEXT",TIUI))
if +TIUI'>0
QUIT
+19 SET TIULINE=$GET(^TIU(8925.2,+TIUBUF,"TEXT",TIUI,0))
if TIULINE[TIUBGN
QUIT
+20 SET TIUCAP=$PIECE(TIULINE,":")
if TIUCAP']""
QUIT
+21 ; -- Get upload header definition data for transcribed
+22 ; caption:
+23 SET TIUN=$ORDER(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP,0))
+24 if +TIUN'>0
QUIT
+25 SET TIUFLD=$PIECE(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,3)
+26 ; -- Ignore caption if hdr def does not associate a
+27 ; field number with it:
+28 if TIUFLD']""
QUIT
+29 SET TIUREQ=$PIECE(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,7)
+30 SET TIUARR(TIUFLD)=$$STRIP^TIULS($PIECE(TIULINE,":",2,99))
+31 SET TIUARR(TIUFLD)=$$TRNSFRM(TIUTYPE,TIUFLD,TIUARR(TIUFLD))
+32 ; -- If caption has no data, and hdr def requires data,
+33 ; set node to create missing field msg in FILE^TIUFIX1.
+34 ; For most fields, "** REQUIRED FIELD MISSING FROM
+35 ; UPLOAD**" will be invalid data and will not file.
+36 ; If field is free text so that it does file, at
+37 ; least it's intelligible.
+38 IF +TIUREQ
IF TIUARR(TIUFLD)=""
SET TIUARR(TIUFLD)="** REQUIRED FIELD MISSING FROM UPLOAD **"
End DoDot:3
if TIULINE[TIUBGN!(+TIUI'>0)
QUIT
End DoDot:2
End DoDot:1
+39 ; -- Leave missing captions fix til later; TIUPUTC1?? needs
+40 ; same change 4/21/02:
+41 ; -- Set nodes for any captions required in upload hdr
+42 ; def but missing from buffer. Check only captions that
+43 ; do NOT have Lookup variables, since that info is supplied
+44 ; by user and is not a missing field. Even if set here,
+45 ; message will be created only for nodes not killed before
+46 ; filing.
+47 ;N TIUCAP,TIUREQ,TIUFLD,LOOKV
+48 ;S TIUCAP=""
+49 ;S TIUCAP=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP)) Q:TIUCAP="" D
+50 ;. S TIUN=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP,0))
+51 ;. S TIUREQ=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,7)
+52 ;. Q:'TIUREQ
+53 ;. S TIUFLD=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,3)
+54 ;. Q:'TIUFLD
+55 ;. S LOOKV=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,4)
+56 ;. Q:LOOKV]""
+57 ;. I '$D(TIUARR(TIUFLD)) S TIUARR(TIUFLD)="** REQUIRED CAPTION MISSING FROM UPLOAD **"
+58 QUIT
TRNSFRM(RTYPE,FLD,X) ; Executes Transform code for a given header field
+1 NEW XFORM
+2 SET FLD=$ORDER(^TIU(8925.1,+RTYPE,"HEAD","D",+FLD,0))
+3 IF +FLD'>0
GOTO TRNSFRMX
+4 SET XFORM=$GET(^TIU(8925.1,+RTYPE,"HEAD",+FLD,1))
+5 IF XFORM']""
GOTO TRNSFRMX
+6 XECUTE XFORM
TRNSFRMX QUIT X