IBDFU91 ;ALB/CJM - ENCOUNTER FORM - transforms needed to validate,display and pass data;AUG 18,1995
;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
;
OUTPUT(PI,Y) ;xecutes the output transform of the package interface on Y
;Y should be passed by reference
;the underlying output transform should set Y="" if the transform can not be made
;in that case Y is set to "?"
;
I $G(PI),$D(Y) X $G(^IBE(357.6,PI,14)) I Y="" S Y="?"
Q
;
INPUT(PI,X) ;xecutes the input transform of the package interface on X
;X should be passed by reference
;the underlying input transform:
; can be interactive if $G(IBDEVICE("LISTMAN"))
; should set X to the form needed for passing to the database
; X should be killed if it can not be put into the correct form
; does not guarantee validity - for example, X could be an inactive code
;
I $G(PI),$D(X) X $G(^IBE(357.6,PI,9))
Q
;
CHOICE(PI,X) ;executes the selector of the package interface=PI, user input is X
; -- X should be passed by reference.
; -- sets IBLABEL,IBID,IBQUAL
;
N DIC,DIE,%,%W,%Y,C,DIPGM,DISYS,I,Q,D,D0,DO,DI,DQ,D1,%X,%Y,Y,DIX,DICR
;execute the selector
I $G(PI) X $G(^IBE(357.6,PI,17))
Q
;
FDCHOICE(PI,X) ;executes the selector of the package interface=PI,X=the user input, then runs it through the input transform for a value that can be passed to the PCE GDI
; -- X should be passed by reference.
;
N DIC,DIE,%,%W,%Y,C,DIPGM,DISYS,I,Q,D,D0,DO,DI,DQ,D1,%X,%Y,Y,DIX,DICR,IBLABEL,IBQUAL,IBID
I $G(PI) D
.;execute the selector
.X $G(^IBE(357.6,PI,17))
.;the selector actually returns the ID for the selection in the variabel IBID - X is the displayable value, which may be different
.;I $G(IBID)="" K X Q
.;pass the selection through the input transform
.I $D(X),$G(IBID)'="" S X=IBID D INPUT(PI,.X)
Q
;
HPTRNS(TYPEDATA,X,IBFORMID) ;used to transform a value read from a hand print field (X) into a value that can be passed to the database
;TYPEDATA = data type (file 359.1)
;IBFORMID = id in form tracking,should be passed by reference
; available form form tracking:
; IBFORMID("DFN")
; IBFORMID("APPT")
; IBFORMID("CLINIC")
; IBFORMID("SOURCE")
;
;X = the value that needs to be transformed
;returns the transformed value
;returns "" if it can not be put inot the correct form
;
;the underlying input transform:
; should not be interactive
; can use the IBFORMID array
; should set X to the form needed for passing to the database
; X should be killed if it can not be put into the correct form
; does not guarantee validity - for example, X could be an inactive code
;
I '$G(TYPEDATA)!'$D(X) S X="" Q X
I '$D(^IBE(359.1,TYPEDATA,0)) S X="" Q
X $G(^IBE(359.1,TYPEDATA,1))
S:'$D(X) X=""
Q X
;
VALIDATE(PI,X) ;used to validate the value stored with a selection(file 357.3)
;PI is assumed to be a selection type package interface
;kills X if not valid, but otherwise does not change it
;pass X by reference
;the underlying validation transform:
; should not be interactive
; should kill X if it is not valid
;
I X="" K X Q
I 'PI K X Q
I '$D(^IBE(357.6,PI,0)) K X Q
X $G(^IBE(357.6,PI,11))
Q
;
HELP(PI) ;writes the help message for the package interface
;
I PI W !,?6,$G(^IBE(357.6,PI,10)),!
I PI D CHOICE(PI,"?")
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBDFU91 3397 printed Nov 22, 2024@18:03:55 Page 2
IBDFU91 ;ALB/CJM - ENCOUNTER FORM - transforms needed to validate,display and pass data;AUG 18,1995
+1 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
+2 ;
OUTPUT(PI,Y) ;xecutes the output transform of the package interface on Y
+1 ;Y should be passed by reference
+2 ;the underlying output transform should set Y="" if the transform can not be made
+3 ;in that case Y is set to "?"
+4 ;
+5 IF $GET(PI)
IF $DATA(Y)
XECUTE $GET(^IBE(357.6,PI,14))
IF Y=""
SET Y="?"
+6 QUIT
+7 ;
INPUT(PI,X) ;xecutes the input transform of the package interface on X
+1 ;X should be passed by reference
+2 ;the underlying input transform:
+3 ; can be interactive if $G(IBDEVICE("LISTMAN"))
+4 ; should set X to the form needed for passing to the database
+5 ; X should be killed if it can not be put into the correct form
+6 ; does not guarantee validity - for example, X could be an inactive code
+7 ;
+8 IF $GET(PI)
IF $DATA(X)
XECUTE $GET(^IBE(357.6,PI,9))
+9 QUIT
+10 ;
CHOICE(PI,X) ;executes the selector of the package interface=PI, user input is X
+1 ; -- X should be passed by reference.
+2 ; -- sets IBLABEL,IBID,IBQUAL
+3 ;
+4 NEW DIC,DIE,%,%W,%Y,C,DIPGM,DISYS,I,Q,D,D0,DO,DI,DQ,D1,%X,%Y,Y,DIX,DICR
+5 ;execute the selector
+6 IF $GET(PI)
XECUTE $GET(^IBE(357.6,PI,17))
+7 QUIT
+8 ;
FDCHOICE(PI,X) ;executes the selector of the package interface=PI,X=the user input, then runs it through the input transform for a value that can be passed to the PCE GDI
+1 ; -- X should be passed by reference.
+2 ;
+3 NEW DIC,DIE,%,%W,%Y,C,DIPGM,DISYS,I,Q,D,D0,DO,DI,DQ,D1,%X,%Y,Y,DIX,DICR,IBLABEL,IBQUAL,IBID
+4 IF $GET(PI)
Begin DoDot:1
+5 ;execute the selector
+6 XECUTE $GET(^IBE(357.6,PI,17))
+7 ;the selector actually returns the ID for the selection in the variabel IBID - X is the displayable value, which may be different
+8 ;I $G(IBID)="" K X Q
+9 ;pass the selection through the input transform
+10 IF $DATA(X)
IF $GET(IBID)'=""
SET X=IBID
DO INPUT(PI,.X)
End DoDot:1
+11 QUIT
+12 ;
HPTRNS(TYPEDATA,X,IBFORMID) ;used to transform a value read from a hand print field (X) into a value that can be passed to the database
+1 ;TYPEDATA = data type (file 359.1)
+2 ;IBFORMID = id in form tracking,should be passed by reference
+3 ; available form form tracking:
+4 ; IBFORMID("DFN")
+5 ; IBFORMID("APPT")
+6 ; IBFORMID("CLINIC")
+7 ; IBFORMID("SOURCE")
+8 ;
+9 ;X = the value that needs to be transformed
+10 ;returns the transformed value
+11 ;returns "" if it can not be put inot the correct form
+12 ;
+13 ;the underlying input transform:
+14 ; should not be interactive
+15 ; can use the IBFORMID array
+16 ; should set X to the form needed for passing to the database
+17 ; X should be killed if it can not be put into the correct form
+18 ; does not guarantee validity - for example, X could be an inactive code
+19 ;
+20 IF '$GET(TYPEDATA)!'$DATA(X)
SET X=""
QUIT X
+21 IF '$DATA(^IBE(359.1,TYPEDATA,0))
SET X=""
QUIT
+22 XECUTE $GET(^IBE(359.1,TYPEDATA,1))
+23 if '$DATA(X)
SET X=""
+24 QUIT X
+25 ;
VALIDATE(PI,X) ;used to validate the value stored with a selection(file 357.3)
+1 ;PI is assumed to be a selection type package interface
+2 ;kills X if not valid, but otherwise does not change it
+3 ;pass X by reference
+4 ;the underlying validation transform:
+5 ; should not be interactive
+6 ; should kill X if it is not valid
+7 ;
+8 IF X=""
KILL X
QUIT
+9 IF 'PI
KILL X
QUIT
+10 IF '$DATA(^IBE(357.6,PI,0))
KILL X
QUIT
+11 XECUTE $GET(^IBE(357.6,PI,11))
+12 QUIT
+13 ;
HELP(PI) ;writes the help message for the package interface
+1 ;
+2 IF PI
WRITE !,?6,$GET(^IBE(357.6,PI,10)),!
+3 IF PI
DO CHOICE(PI,"?")
+4 QUIT