| [613] | 1 | VAQDIS40 ;ALB/JFP - PDX, BUILDS DISPLAY ARRAY FOR PHA DATA ;01MAR93
 | 
|---|
 | 2 |  ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
 | 
|---|
 | 3 | DISPMP(XTRCT,SEGPTR,ROOT,OFFSET,DSP) ;SAMPLE DISPLAY METHOD
 | 
|---|
 | 4 |  ;INPUT : XTRCT  - Input array (full global reference)
 | 
|---|
 | 5 |  ;        SEGPTR - Segment to extract (ptr to file #394.71)
 | 
|---|
 | 6 |  ;        ROOT   - Output array (full global reference)
 | 
|---|
 | 7 |  ;        OFFSET - Starting line for display
 | 
|---|
 | 8 |  ;        DSP    - Flag to set display option (1-on,0-off)
 | 
|---|
 | 9 |  ;OUTPUT: n      - Number of lines added to display
 | 
|---|
 | 10 |  ;       -1^ErrorText - Error
 | 
|---|
 | 11 |  ;
 | 
|---|
 | 12 |  ; -- Check input
 | 
|---|
 | 13 |  Q:('$D(XTRCT)) "-1^Input array not passed on input"
 | 
|---|
 | 14 |  Q:('$D(SEGPTR)) "-1^Segment not passed on input"
 | 
|---|
 | 15 |  Q:('$D(ROOT)) "-1^Output array not passed on input"
 | 
|---|
 | 16 |  Q:('$D(OFFSET)) "-1^Starting line for display not passed on input"
 | 
|---|
 | 17 |  ;
 | 
|---|
 | 18 |  S:('$D(DSP)) DSP=1
 | 
|---|
 | 19 |  ; -- Declare variables
 | 
|---|
 | 20 |  N X,VAQSEGND,VALMCNT
 | 
|---|
 | 21 |  ;
 | 
|---|
 | 22 |  S VAQSEGND=$G(^VAT(394.71,SEGPTR,0))
 | 
|---|
 | 23 |  S VAQSEGNM=$P(VAQSEGND,U,2)
 | 
|---|
 | 24 |  Q:(VAQSEGNM="") "-1^Invalid segment"
 | 
|---|
 | 25 |  S VALMCNT=$S(DSP=1:OFFSET-1,1:0)
 | 
|---|
 | 26 |  I DSP=1 S ROOT=$$ROOT^VAQDIS20(ROOT)
 | 
|---|
 | 27 |  ;
 | 
|---|
 | 28 |  ; -- Build display segment
 | 
|---|
 | 29 |  S FORMTYPE=$S(VAQSEGNM="PDX*MPS":0,1:1)
 | 
|---|
 | 30 |  S X=$$PRINT^VAQDIS41(FORMTYPE)
 | 
|---|
 | 31 |  ; -- Clean up variables
 | 
|---|
 | 32 |  K X,VAQSEGND,VAQSEGNM,TMP,ROOT,FORMTYPE
 | 
|---|
 | 33 |  ; -- End
 | 
|---|
 | 34 |  QUIT VALMCNT-OFFSET
 | 
|---|
 | 35 |  ;
 | 
|---|
 | 36 | END ; -- End of code
 | 
|---|
 | 37 |  QUIT
 | 
|---|