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

VAQCON8.m

Go to the documentation of this file.
  1. VAQCON8 ;ALB/JRP - MESSAGE CONSTRUCTION;2-SEP-93
  1. ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
  1. DISPLAY(TRANPTR,SEGABB,DSPARR,STARTOFF,DSPSIZE,MESSNUM,ARRAY,OFFSET) ;CONSTRUCT DISPLAY BLOCK
  1. ;INPUT : TRANPTR - Pointer to VAQ - TRANSACTION file
  1. ; SEGABB - Segment abbreviation for segment
  1. ; DSPARR - Location of displayable Extraction Array
  1. ; (full global reference)
  1. ; STARTOFF - Where information in DSPARR begins (defaults to 0)
  1. ; DSPSIZE - Number of lines in DSPARR to move (defaults to all)
  1. ; MESSNUM - Message number to place block into
  1. ; (if 0, block will be placed in ARRAY)
  1. ; ARRAY - Array to store block in (full global reference)
  1. ; OFFSET - Where to begin placing information (defaults to 0)
  1. ;OUTPUT : N - Number of lines in block
  1. ; -1^Error_Text - Error
  1. ;NOTES : If MESSNUM=0, then the block will be placed into
  1. ; ARRAY(LineNumber)=Line_of_info
  1. ; If MESSNUM>0 then the block will be placed into
  1. ; ^XMB(3.9,MESSNUM,2,LineNumber,0)=Line_of_info
  1. ;
  1. ;CHECK INPUT
  1. S TRANPTR=+$G(TRANPTR)
  1. Q:(('TRANPTR)!('$D(^VAT(394.61,TRANPTR)))) "-1^Did not pass a valid pointer to VAQ - TRANSACTION file"
  1. Q:($G(SEGABB)="") "-1^Did not pass segment abbreviation"
  1. Q:($G(DSPARR)="") "-1^Did not pass location of Extraction Array"
  1. S STARTOFF=+$G(STARTOFF)
  1. S DSPSIZE=$G(DSPSIZE)
  1. S MESSNUM=+$G(MESSNUM)
  1. I (('MESSNUM)&($G(ARRAY)="")) Q "-1^Did not pass message number of reference to array"
  1. I (MESSNUM) Q:('$D(^XMB(3.9,MESSNUM))) "-1^Valid message number not passed"
  1. S OFFSET=+$G(OFFSET)
  1. ;DECLARE VARIABLES
  1. N TMP,LINE,STOP,NCRYPTON,START,X
  1. S LINE=OFFSET
  1. ;DETERMINE IF ENCRYPTION WAS TURNED ON
  1. S NCRYPTON=$$TRANENC^VAQUTL3(TRANPTR,0)
  1. ;DETERMINE NUMBER OF LINES IN DISPLAY (IF NOT PASSED)
  1. I (DSPSIZE="") D
  1. .S DSPSIZE=0
  1. .S START=STARTOFF-.999999999
  1. .F S START=$O(@DSPARR@("DISPLAY",START)) Q:(START="") S DSPSIZE=DSPSIZE+1
  1. ;LINE 1
  1. S TMP="$DISPLAY"
  1. S:('MESSNUM) @ARRAY@(LINE)=TMP
  1. S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
  1. S LINE=LINE+1
  1. ;LINE 2
  1. S TMP=SEGABB
  1. S:('MESSNUM) @ARRAY@(LINE)=TMP
  1. S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
  1. S LINE=LINE+1
  1. ;LINE 3
  1. S TMP=NCRYPTON_"^"_DSPSIZE
  1. S:('MESSNUM) @ARRAY@(LINE)=TMP
  1. S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
  1. S LINE=LINE+1
  1. ;LINES IN SEGMENT
  1. S STOP=0
  1. I (DSPSIZE) D
  1. .S START=STARTOFF-.999999999
  1. .F S START=$O(@DSPARR@("DISPLAY",START)) Q:((START="")!(STOP>(DSPSIZE-1))) D
  1. ..S TMP=$G(@DSPARR@("DISPLAY",START,0))
  1. ..S:('MESSNUM) @ARRAY@(LINE)=TMP
  1. ..S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
  1. ..S LINE=LINE+1
  1. ..S STOP=STOP+1
  1. ;ADJUST DISPLAY SIZE IN LINE 3 (IF NEEDED)
  1. I (STOP<DSPSIZE) D
  1. .S TMP=NCRYPTON_"^"_STOP
  1. .S:('MESSNUM) @ARRAY@(OFFSET+2)=TMP
  1. .S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,(OFFSET+2))
  1. ;LINE Z
  1. S TMP="$$DISPLAY"
  1. S:('MESSNUM) @ARRAY@(LINE)=TMP
  1. S:(MESSNUM) X=$$ADDLINE^VAQCON1(TMP,MESSNUM,LINE)
  1. S LINE=LINE+1
  1. Q (LINE-OFFSET)