Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: TIUFIX2

TIUFIX2.m

Go to the documentation of this file.
  1. TIUFIX2 ; SLC/JER,MAM - Resolve Upload Filing Errors Library Two ;05/06/02
  1. ;;1.0;TEXT INTEGRATION UTILITIES;**131**;Jun 20, 1997
  1. ;
  1. BUFFER(TIUEVNT) ; Return 8925.2 Upload Buffer IEN
  1. ; Gets Buffer for UNRESOLVED upload errors. (Returns error msg
  1. ;for resolved filing errors, where buffer is 0.)
  1. ; Requires [TIUEVNT] - Upload Log Event IEN (8925.4)
  1. N TIUBUF
  1. I '$D(^TIU(8925.4,TIUEVNT,0)) S TIUBUF="0^Invalid Upload Log event." G BUFX
  1. S TIUBUF=+$P($G(^TIU(8925.4,TIUEVNT,0)),U,5)
  1. I TIUBUF'>0 S TIUBUF="0^Upload Buffer record is missing from Upload Log event." G BUFX
  1. I '$D(^TIU(8925.2,TIUBUF,0)) S TIUBUF="0^Upload Log event references an invalid Upload Buffer record."
  1. BUFX Q TIUBUF
  1. ;
  1. LOADHDR(TIUARR,TIUBUF,TIUPRM0,TIUTYPE) ; Load array with header data
  1. ;from upload buffer
  1. ; Requires [TIUARR] - Array of header data. Loaded and passed back
  1. ; [TIUBUF] - 8925.2 Upload Buffer IEN
  1. ; [TIUPRM0] - Header signal, etc. See SETPARM^TIULE
  1. ; [TIUTYPE] - IEN of Docmt Def whose Filing Error
  1. ; Resolution Code is being invoked
  1. ;NOTE: LOADHDR does NOT kill ANY nodes of TIUARR.
  1. ; (LOADTIUX^TIUPEFIX does kill certain nodes.)
  1. ; See warning in MAKE^TIUFIX1 concerning possible
  1. ; need to kill nodes of array.
  1. N TIUI,TIUHSIG,TIUBGN,TIULINE
  1. S TIUHSIG=$P(TIUPRM0,U,10),TIUBGN=$P(TIUPRM0,U,12)
  1. S TIUI=0 F S TIUI=$O(^TIU(8925.2,+TIUBUF,"TEXT",TIUI)) Q:+TIUI'>0 D
  1. . S TIULINE=$G(^TIU(8925.2,+TIUBUF,"TEXT",TIUI,0))
  1. . I TIULINE[TIUHSIG D
  1. . . F D Q:TIULINE[TIUBGN!(+TIUI'>0)
  1. . . . N TIUN,TIUCAP,TIUFLD,TIUREQ S TIUREQ=0
  1. . . . S TIUI=$O(^TIU(8925.2,+TIUBUF,"TEXT",TIUI)) Q:+TIUI'>0
  1. . . . S TIULINE=$G(^TIU(8925.2,+TIUBUF,"TEXT",TIUI,0)) Q:TIULINE[TIUBGN
  1. . . . S TIUCAP=$P(TIULINE,":") Q:TIUCAP']""
  1. . . . ; -- Get upload header definition data for transcribed
  1. . . . ; caption:
  1. . . . S TIUN=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP,0))
  1. . . . Q:+TIUN'>0
  1. . . . S TIUFLD=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,3)
  1. . . . ; -- Ignore caption if hdr def does not associate a
  1. . . . ; field number with it:
  1. . . . Q:TIUFLD']""
  1. . . . S TIUREQ=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,7)
  1. . . . S TIUARR(TIUFLD)=$$STRIP^TIULS($P(TIULINE,":",2,99))
  1. . . . S TIUARR(TIUFLD)=$$TRNSFRM(TIUTYPE,TIUFLD,TIUARR(TIUFLD))
  1. . . . ; -- If caption has no data, and hdr def requires data,
  1. . . . ; set node to create missing field msg in FILE^TIUFIX1.
  1. . . . ; For most fields, "** REQUIRED FIELD MISSING FROM
  1. . . . ; UPLOAD**" will be invalid data and will not file.
  1. . . . ; If field is free text so that it does file, at
  1. . . . ; least it's intelligible.
  1. . . . I +TIUREQ,TIUARR(TIUFLD)="" S TIUARR(TIUFLD)="** REQUIRED FIELD MISSING FROM UPLOAD **"
  1. ; -- Leave missing captions fix til later; TIUPUTC1?? needs
  1. ; same change 4/21/02:
  1. ; -- Set nodes for any captions required in upload hdr
  1. ; def but missing from buffer. Check only captions that
  1. ; do NOT have Lookup variables, since that info is supplied
  1. ; by user and is not a missing field. Even if set here,
  1. ; message will be created only for nodes not killed before
  1. ; filing.
  1. ;N TIUCAP,TIUREQ,TIUFLD,LOOKV
  1. ;S TIUCAP=""
  1. ;S TIUCAP=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP)) Q:TIUCAP="" D
  1. ;. S TIUN=$O(^TIU(8925.1,TIUTYPE,"HEAD","B",TIUCAP,0))
  1. ;. S TIUREQ=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,7)
  1. ;. Q:'TIUREQ
  1. ;. S TIUFLD=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,3)
  1. ;. Q:'TIUFLD
  1. ;. S LOOKV=$P(^TIU(8925.1,TIUTYPE,"HEAD",+TIUN,0),U,4)
  1. ;. Q:LOOKV]""
  1. ;. I '$D(TIUARR(TIUFLD)) S TIUARR(TIUFLD)="** REQUIRED CAPTION MISSING FROM UPLOAD **"
  1. Q
  1. TRNSFRM(RTYPE,FLD,X) ; Executes Transform code for a given header field
  1. N XFORM
  1. S FLD=$O(^TIU(8925.1,+RTYPE,"HEAD","D",+FLD,0))
  1. I +FLD'>0 G TRNSFRMX
  1. S XFORM=$G(^TIU(8925.1,+RTYPE,"HEAD",+FLD,1))
  1. I XFORM']"" G TRNSFRMX
  1. X XFORM
  1. TRNSFRMX Q X