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

IBDFU5.m

Go to the documentation of this file.
  1. IBDFU5 ;ALB/CJM - ENCOUNTER FORM (utilities) ;JAN 16,1993
  1. ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
  1. TOPNBOT(BLOCK,TOP,BOT) ;finds the top and bottom of the block - pass TOP and BOT by reference
  1. N NODE
  1. S NODE=$G(^IBE(357.1,BLOCK,0))
  1. S TOP=+$P(NODE,"^",4),BOT=(TOP+(+$P(NODE,"^",7)))-1
  1. Q
  1. RUSURE(NAME) ;obtains verification from the user for deletion- returns 1 if answered YES, otherwise NO
  1. ;if NAME is defined it will be used in the prompt
  1. N RET
  1. S RET=1
  1. K DIR S DIR(0)="Y",DIR("A")=$S(NAME="":"Are you sure",1:"Are you sure "_NAME_" should be deleted"),DIR("B")="NO"
  1. D ^DIR K DIR I (Y<1)!$D(DIRUT) S RET=0
  1. Q RET
  1. PAUSE ;
  1. N ANS
  1. W !,$C(7),"Press RETURN to continue..." R ANS:DTIME
  1. Q
  1. ;
  1. NOGRPHCS ;sets graphics variables to "_" and "|"
  1. S (IOVL,IOBLC,IOBRC)="|",(IOHL,IOTRC,IOTLC)="_"
  1. Q
  1. ;
  1. HELP1 ;displays a list of the record's fields from file 357.6, IB PACKAGE INTERFACE file - EXECUTABLE HELP FOR FIELDS IN THE DATA FIELD FILE
  1. ;
  1. ;INPUT - D0 is a pointer to a DATA FIELD (file 357.5)
  1. ;
  1. N RTN
  1. Q:'$G(D0)
  1. W !,"WHAT DATA SHOULD BE PRINTED IN THE SUBFIELD? CHOOSE FROM:"
  1. S RTN=$P($G(^IBE(357.5,D0,0)),"^",3) Q:'RTN
  1. D SHOWDATA
  1. Q
  1. HELP2 ;displays a list of the record's fields from file 357.6, IB PACKAGE INTERFACE file - EXECUTABLE HELP FOR FIELDS IN THE SELECTION LIST FILE
  1. ;
  1. ;INPUT - D0 should be a pointer to a SELECTION LIST
  1. ;
  1. N RTN
  1. W !,"WHAT DATA SHOULD BE PRINTED IN THIS SUBCOLUMN? CHOOSE FROM:"
  1. Q:'$G(D0)
  1. S RTN=$P($G(^IBE(357.2,D0,0)),"^",11) Q:'RTN
  1. D SHOWDATA
  1. W !,"You can also enter 0 if you want the item number entered in the subcolumn.",!
  1. Q
  1. ;
  1. HELP3 ;displays a list of the record's fields from file 357.6, IB PACKAGE INTERFACE file - used to display available data to the user before he enters a data field label
  1. ;
  1. ;INPUT - D0 is a pointer to a DATA FIELD (file 357.5)
  1. N RTN
  1. W !,"Available Data:"
  1. Q:'$G(D0)
  1. S RTN=$P($G(^IBE(357.5,D0,0)),"^",3) Q:'RTN
  1. D SHOWDATA
  1. Q
  1. ;
  1. HELP4 ;displays a list of the record's fields from file 357.6, IB PACKAGE INTERFACE file - used to display to the user the available data before a subcolumn to a selection list
  1. ;
  1. ;INPUT - D0 should be a pointer to a SELECTION LIST
  1. ;
  1. N RTN
  1. W !,"Available Data:"
  1. Q:'$G(D0)
  1. S RTN=$P($G(^IBE(357.2,D0,0)),"^",11) Q:'RTN
  1. D SHOWDATA
  1. Q
  1. HELP5 ;for number of columns in list
  1. I $G(IBDEVICE("LISTMAN")) D FULL^VALM1
  1. W !!,"A selection list COLUMN contains items on the list. It may consist of several",!,"subcolumns. For example, a typical column may have three subcolumns, one"
  1. W !,"containing a code, the second a description, and the third a marking area for",!,"the user to indicate his selections from the list. Besides going down the",!,"form, the list can can go across the form by having multiple columns."
  1. W !!,"Entering the number of columns is optional. By default the entire block will",!,"be filled with the list.",!
  1. I $G(IBDEVICE("LISTMAN")) D PAUSE^IBDFU5,RE^VALM4
  1. Q
  1. ;
  1. SHOWDATA ;displays a discription of the the record returned by the package interface
  1. ;
  1. ;INPUT - RTN - ptr to the package interface file
  1. N NODE,SUB,ROW,COL,LINE,DESCR,CANSHOW,IEN
  1. S NODE=$G(^IBE(357.6,RTN,2))
  1. ;
  1. ;piece 1 may not be displayable (an ien)
  1. S CANSHOW=$S($P(NODE,"^",17)=0:0,1:1)
  1. I 'CANSHOW S NODE=""
  1. ;
  1. F ROW=0:1:3 S LINE="" D W:(LINE'="") !,LINE
  1. .F COL=1:1:2 S SUB=COL+(2*ROW) D Q:LINE=""
  1. ..S DESCR=""
  1. ..I (SUB'=1) S NODE="",IEN=$O(^IBE(357.6,RTN,15,"C",SUB,0)) S:IEN NODE=$G(^IBE(357.6,RTN,15,IEN,0))
  1. ..I NODE="" I (COL=1&'$D(^IBE(357.6,RTN,15,"C",SUB+1)))!((COL'=1)&(DESCR="(not applicable)")) Q
  1. ..S DESCR=$P(NODE,"^") I DESCR'="" S DESCR=DESCR_" :"_$P(NODE,"^",2)_" char"
  1. ..I DESCR="" S DESCR="(N/A)"
  1. ..S LINE=LINE_$S(DESCR="":"",1:$$PADRIGHT^IBDFU(" "_SUB_"= "_DESCR,39))
  1. Q
  1. ;
  1. RESET ;resets the scrolling area of the screen to that defined by List Manager
  1. ;I $G(IOSTBM)'="" S IOTM=IOSL-4,IOBM=IOSL W IOSC,@IOSTBM,IORC
  1. Q
  1. VARIABLE(VAR) ;returns 0 if VAR is not syntactically a good local variable name, 1 otherwise
  1. N I,LEN,CHAR,GOOD
  1. S LEN=$L(VAR)
  1. S CHAR=$E(VAR)
  1. I '((CHAR?1A)!(CHAR="%")) Q 0
  1. S GOOD=1
  1. F I=2:1:LEN S CHAR=$E(VAR,I) I '((CHAR?1A)!(CHAR?1N)) S GOOD=0 Q
  1. Q GOOD
  1. ID1 ;writes identifier for subcolumn of selection list (file 357.2)
  1. N NODE,TYPE,PIECE,IEN
  1. S NODE=$G(^(0)) Q:NODE=""
  1. W "HEADER=",$$PADRIGHT^IBDFU($P(NODE,U,2),27)_" CONTENT="
  1. I $P(NODE,U,4)=1 D
  1. .S TYPE=$P($G(^IBE(357.2,D0,0)),"^",11) Q:'TYPE
  1. .S PIECE=+$P(NODE,U,5)
  1. .W:'PIECE "#COUNT"
  1. .W:PIECE $$DATANAME^IBDFU1B(TYPE,PIECE)
  1. I $P(NODE,U,4)=2 D
  1. .S TYPE=$P(NODE,U,6) Q:'TYPE
  1. .W $P($G(^IBE(357.91,TYPE,0)),U)
  1. Q
  1. ;
  1. DFLTS() ;returns the default form if found, 0 otherwise
  1. N FORM
  1. S FORM=0 F S FORM=$O(^IBE(357,"B","DEFAULTS",FORM)) Q:'FORM Q:$P($G(^IBE(357,FORM,0)),"^",7)
  1. Q FORM
  1. ;
  1. OKPIECE(PI,PIECE) ;returns 1 if the piece=PIECE is selectable for the package interface=PI, 0 otherwise
  1. ;
  1. I ('$G(PIECE))!('$G(PI)) Q 0
  1. N QUIT S QUIT=0
  1. I PIECE=1 S QUIT=$S($P($G(^IBE(357.6,PI,2)),"^",17)'=0:1,1:0)
  1. I PIECE'=1 S QUIT=$D(^IBE(357.6,PI,15,"C",PIECE))
  1. Q QUIT