IBCEFG70 ; ALB/TMP - OUTPUT FORMATTER GENERIC SCREEN PROCESSING; 02-APR-96
;;Version 2.0 ; INTEGRATED BILLING ;**52**; 21-MAR-94
;
SCRN(IBFORM,IBXIEN) ; Build screen display for form IBFORM and entry IBXIEN
N Z,Z0,Z1,Z2,LAST,IBGRP
D CLEAR^VALM1
S LAST=$O(^TMP("IBXEDIT",$J,""),-1),IBGRP=""
F D Q:IBGRP=""
.F Z=1:1 Q:$O(^TMP("IBXDATA",$J,1,1,Z-1))="" W ! D:$D(^TMP("IBXDATA",$J,1,1,Z))
..S Z0="" F S Z0=$O(^TMP("IBXDATA",$J,1,1,Z,Z0)) Q:Z0="" W ?Z0,^(Z0)
.F Z=Z:1:$S($P($G(^IBE(353,IBFORM,2)),U,3):$P(^(2),U,3)-1,1:19) W !
.W !,"<RET> or '^' to QUIT or 1-",LAST," to EDIT: "
.R IBGRP:DTIME
.I "^"[IBGRP S IBGRP="" Q
.I 'IBGRP!(IBGRP>LAST) W:IBGRP'="?" *7 D HELP S IBGRP="REASK" Q
.D EDIT(IBGRP,IBFORM,IBXIEN)
Q
;
EDIT(IBGRP,IBFORM,IBXIEN) ; Generic edit fields on a screen form IBFORM
;Loop here to read the group to edit (IBGRP)
; IBXIEN = entry number
N Z,DR,DA,DIE,FLDS,Z0
F Z=1:1:$L(IBGRP,",") S Z0=$P(IBGRP,",",Z) D:IBGRP'=""
.I IBGRP'["-" S FLDS(+IBGRP)="" Q
.F Z1=+IBGRP:1:$P(IBGRP,"-",2) S FLDS(Z1)=""
S DR=""
S IBGRP="" F S IBGRP=$O(FLDS(IBGRP)) Q:'IBGRP S Z=0 F S Z=$O(^TMP("IBXEDIT",$J,IBGRP,Z)) Q:'Z S DR=DR_$S($L(DR):";",1:"")_^(Z)
I $L(DR) S DIE=+$G(^IBE(353,IBFORM,2)),DA=IBXIEN D ^DIE
D CLEAR^VALM1
Q
;
HELP ; Help for group prompt
N X,I
W !,"Enter '^' to stop the display and edit of data, or enter"
W !,"the field group number(s) you wish to edit using commas and dashes as",!,"delimiters. The elements that are editable are assigned a group number",!,"enclosed in brackets ""[]"" while those without group numbers are not."
W ! F I=$Y:1:20 W !
S Z="PRESS <RETURN> KEY to RETURN to SCREEN " R X:DTIME
Q
--- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HIBCEFG70 1703 printed Oct 16, 2024@18:11:18 Page 2
IBCEFG70 ; ALB/TMP - OUTPUT FORMATTER GENERIC SCREEN PROCESSING; 02-APR-96
+1 ;;Version 2.0 ; INTEGRATED BILLING ;**52**; 21-MAR-94
+2 ;
SCRN(IBFORM,IBXIEN) ; Build screen display for form IBFORM and entry IBXIEN
+1 NEW Z,Z0,Z1,Z2,LAST,IBGRP
+2 DO CLEAR^VALM1
+3 SET LAST=$ORDER(^TMP("IBXEDIT",$JOB,""),-1)
SET IBGRP=""
+4 FOR
Begin DoDot:1
+5 FOR Z=1:1
if $ORDER(^TMP("IBXDATA",$JOB,1,1,Z-1))=""
QUIT
WRITE !
if $DATA(^TMP("IBXDATA",$JOB,1,1,Z))
Begin DoDot:2
+6 SET Z0=""
FOR
SET Z0=$ORDER(^TMP("IBXDATA",$JOB,1,1,Z,Z0))
if Z0=""
QUIT
WRITE ?Z0,^(Z0)
End DoDot:2
+7 FOR Z=Z:1:$SELECT($PIECE($GET(^IBE(353,IBFORM,2)),U,3):$PIECE(^(2),U,3)-1,1:19)
WRITE !
+8 WRITE !,"<RET> or '^' to QUIT or 1-",LAST," to EDIT: "
+9 READ IBGRP:DTIME
+10 IF "^"[IBGRP
SET IBGRP=""
QUIT
+11 IF 'IBGRP!(IBGRP>LAST)
if IBGRP'="?"
WRITE *7
DO HELP
SET IBGRP="REASK"
QUIT
+12 DO EDIT(IBGRP,IBFORM,IBXIEN)
End DoDot:1
if IBGRP=""
QUIT
+13 QUIT
+14 ;
EDIT(IBGRP,IBFORM,IBXIEN) ; Generic edit fields on a screen form IBFORM
+1 ;Loop here to read the group to edit (IBGRP)
+2 ; IBXIEN = entry number
+3 NEW Z,DR,DA,DIE,FLDS,Z0
+4 FOR Z=1:1:$LENGTH(IBGRP,",")
SET Z0=$PIECE(IBGRP,",",Z)
if IBGRP'=""
Begin DoDot:1
+5 IF IBGRP'["-"
SET FLDS(+IBGRP)=""
QUIT
+6 FOR Z1=+IBGRP:1:$PIECE(IBGRP,"-",2)
SET FLDS(Z1)=""
End DoDot:1
+7 SET DR=""
+8 SET IBGRP=""
FOR
SET IBGRP=$ORDER(FLDS(IBGRP))
if 'IBGRP
QUIT
SET Z=0
FOR
SET Z=$ORDER(^TMP("IBXEDIT",$JOB,IBGRP,Z))
if 'Z
QUIT
SET DR=DR_$SELECT($LENGTH(DR):";",1:"")_^(Z)
+9 IF $LENGTH(DR)
SET DIE=+$GET(^IBE(353,IBFORM,2))
SET DA=IBXIEN
DO ^DIE
+10 DO CLEAR^VALM1
+11 QUIT
+12 ;
HELP ; Help for group prompt
+1 NEW X,I
+2 WRITE !,"Enter '^' to stop the display and edit of data, or enter"
+3 WRITE !,"the field group number(s) you wish to edit using commas and dashes as",!,"delimiters. The elements that are editable are assigned a group number",!,"enclosed in brackets ""[]"" while those without group numbers are not."
+4 WRITE !
FOR I=$Y:1:20
WRITE !
+5 SET Z="PRESS <RETURN> KEY to RETURN to SCREEN "
READ X:DTIME
+6 QUIT