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

TIUFLT.m

Go to the documentation of this file.
  1. TIUFLT ; SLC/MAM - Library; Template T (Items) Related: BUFITEMS(CONTENT,EINFO,LASTLIN), ITEMS(FILEDA) ;4/6/95 11:02
  1. ;;1.0;TEXT INTEGRATION UTILITIES;;Jun 20, 1997
  1. ;
  1. BUFITEMS(CONTENT,EINFO,LASTLIN) ; Set items of Entry EINFO into
  1. ;Buffer array in proper order.
  1. ; Requires CONTENT = String containing some or all of: 80, H, C, A, D, T, W. See BUFENTRY^TIUFLLM2.
  1. ; Requires EINFO, where EINFO is either as set in NINFO^TIUFLLM or
  1. ;is = ^TMP("TIUFIDX,$J,LINENO).
  1. ; Requires LASTLIN=LM array line before item insertion point.
  1. ; Requires all of the entry's items to exist in the file: check before calling this module.
  1. ; Updates LASTLIN to last line set in buffer array, ie
  1. ;buffer array starts with line [received LASTLIN+1] and ends with
  1. ;line [returned LASTLIN].
  1. N FILEDA,TIUFITEM,LINENO,TIUFI,IFILEDA,ITENDA,INFO,INODE0
  1. S FILEDA=$P(EINFO,U,2)
  1. I TIUFTMPL="C",TIUFCLPS S TIUFITEM(1)=TIUFCDA_U_TIUFCTDA
  1. E D ITEMS(FILEDA)
  1. K ^TMP("TIUFB",$J),^TMP("TIUFBIDX",$J)
  1. S LINENO=LASTLIN
  1. F TIUFI=1:1 Q:'$G(TIUFITEM(TIUFI)) D Q:$D(DTOUT)
  1. . S IFILEDA=$P(TIUFITEM(TIUFI),U),ITENDA=$P(TIUFITEM(TIUFI),U,2) Q:'IFILEDA Q:'ITENDA
  1. . S LINENO=LINENO+1 ;Needed by NINFO.
  1. . D NINFO^TIUFLLM(LINENO,IFILEDA,.INFO,EINFO,ITENDA),PARSE^TIUFLLM(.INFO)
  1. . D NODE0ARR^TIUFLF(IFILEDA,.INODE0,FILEDA) Q:$D(DTOUT)
  1. . I INODE0="" S LINENO=LINENO-1 Q
  1. . D BUFENTRY^TIUFLLM2(.INFO,.INODE0,CONTENT,FILEDA) I TIUFI>5 W "."
  1. . Q
  1. S LASTLIN=LINENO
  1. Q
  1. ;
  1. ITEMS(FILEDA) ; Sets items of FILEDA into array TIUFITEM in proper order.
  1. ; TIUFITEM(TIUFI)=Item's 8925.1 IFN^Item's IFN in Item multiple
  1. ; Requires FILEDA = Entry's 8925.1 IFN
  1. N TIUFI,SEQ,TENDA,TENODE0,NAME
  1. S (TIUFI,SEQ,TENDA)=0
  1. F S SEQ=$O(^TIU(8925.1,FILEDA,10,"AC",SEQ)) Q:'SEQ D
  1. . ; Set items having sequence into TIUFITEM in sequence order
  1. . F S TENDA=$O(^TIU(8925.1,FILEDA,10,"AC",SEQ,TENDA)) Q:'TENDA D
  1. . . S TENODE0=^TIU(8925.1,FILEDA,10,TENDA,0) Q:'TENODE0
  1. . . S TIUFI=TIUFI+1,TIUFITEM(TIUFI)=+TENODE0_"^"_TENDA
  1. S NAME=""
  1. F S NAME=$O(^TIU(8925.1,FILEDA,10,"C",NAME)) Q:NAME="" D
  1. . ; Set items with no sequence into TIUFITEM in alpha order by Display Name.
  1. . S TENDA=0
  1. . F S TENDA=$O(^TIU(8925.1,FILEDA,10,"C",NAME,TENDA)) Q:'TENDA D
  1. . . S TENODE0=^TIU(8925.1,FILEDA,10,TENDA,0) Q:'TENODE0
  1. . . Q:$P(TENODE0,U,3) ;If has sequence, already in TIUFITEM.
  1. . . S TIUFI=TIUFI+1,TIUFITEM(TIUFI)=+TENODE0_"^"_TENDA
  1. S TENDA=0
  1. F S TENDA=$O(^TIU(8925.1,FILEDA,10,TENDA)) Q:'TENDA D
  1. . ; Set items with no sequence, no display name into buffer in item order
  1. . S TENODE0=^TIU(8925.1,FILEDA,10,TENDA,0) Q:'TENODE0
  1. . Q:$P(TENODE0,U,3) ;If has sequence, already in TIUFITEM.
  1. . Q:$P(TENODE0,U,4)'="" ;If has Display Name, already in TIUFITEM.
  1. . S TIUFI=TIUFI+1,TIUFITEM(TIUFI)=+TENODE0_"^"_TENDA
  1. Q
  1. ;