| 1 | IBDFGRP ;ALB/MAF - GROUP COPY - 7/25/95
|
---|
| 2 | ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
|
---|
| 3 | N NEWLIST,NEWBLOCK
|
---|
| 4 | S NEWLIST=IBLIST,NEWBLOCK=IBBLK
|
---|
| 5 | N IBBLK,TOP,BOT,IBLIST,IBFORM
|
---|
| 6 | S VALMBCK="R"
|
---|
| 7 | S IBBLK=$$SELECT2()
|
---|
| 8 | Q:'IBBLK
|
---|
| 9 | ;
|
---|
| 10 | S DIC("S")="I $P(^(0),U,11)=$P($G(^IBE(357.2,+NEWLIST,0)),U,11)" D SELECT^IBDF3 K DIC
|
---|
| 11 | ;
|
---|
| 12 | I '$G(IBLIST) W !!,"Block does not contain same type of selection list '"_$P($G(^IBE(357.6,+$P($G(^IBE(357.2,+NEWLIST,0)),U,11),0)),U)_"'.",! D PAUSE^IBDFU5
|
---|
| 13 | ;
|
---|
| 14 | I IBLIST D EN^VALM("IBDF QUICK GRP COPY")
|
---|
| 15 | Q
|
---|
| 16 | ;
|
---|
| 17 | INIT ; -- init variables and list array
|
---|
| 18 | N IBDCNT,IBDCNT1
|
---|
| 19 | K ^TMP("GRP",$J),^TMP("GRPIDX",$J),IBDFHDR D KILL^VALM10()
|
---|
| 20 | ;
|
---|
| 21 | ; -- Set up arrays for new and old selection list definitions in
|
---|
| 22 | ; in file 357.2. Used to match data with the right subcolum #
|
---|
| 23 | ; when copying selection lists to a form.
|
---|
| 24 | ;
|
---|
| 25 | ; - IBDFNEW(SUBCOLUM #) = TYPE OF DATA ..5th piece (text or code)
|
---|
| 26 | ; - IBDFOLD(SUBCOLUM #) = TYPE OF DATA..5th piece (text or code)
|
---|
| 27 | D
|
---|
| 28 | .N K,NODE
|
---|
| 29 | .S (IBDFNEW,IBDFOLD)=0
|
---|
| 30 | .I $D(IBLIST) S K=0 D
|
---|
| 31 | ..F S K=$O(^IBE(357.2,IBLIST,2,K)) Q:'K S NODE=$G(^IBE(357.2,IBLIST,2,K,0)),IBDFOLD(+NODE)=+$P(NODE,"^",5)
|
---|
| 32 | ..Q
|
---|
| 33 | .I $D(NEWLIST) S NODE="",K=0 D
|
---|
| 34 | ..F S K=$O(^IBE(357.2,NEWLIST,2,K)) Q:'K S NODE=$G(^IBE(357.2,NEWLIST,2,K,0)),IBDFNEW(+NODE)=+$P(NODE,"^",5)
|
---|
| 35 | ..Q
|
---|
| 36 | S (IBDCNT,IBDCNT1,VALMCNT)=0
|
---|
| 37 | S IBDLSTNM=$P(^IBE(357.2,IBLIST,0),"^",1) D INTER D
|
---|
| 38 | .S IBLSNODE=$G(^IBE(357.2,IBLIST,0))
|
---|
| 39 | .I $D(IBDFAR) F IBDFX=0:0 S IBDFX=$O(@(IBDFAR_"("_IBDFX_")")) Q:'IBDFX S IBDFARR=$G(@(IBDFAR_"("_IBDFX_")")) D:$P(IBDFARR,"^",1)="" HEADER D:$P(IBDFARR,"^",1)]"" SETARR
|
---|
| 40 | Q:$$LSTDESCR^IBDFU1(.IBLIST) 1
|
---|
| 41 | S IBRTN=IBLIST("RTN")
|
---|
| 42 | D RTNDSCR^IBDFU1B(.IBRTN)
|
---|
| 43 | Q
|
---|
| 44 | ;
|
---|
| 45 | SETARR ; -- Set up Listman array
|
---|
| 46 | N IBDFNODE
|
---|
| 47 | S IBDFNODE=IBDFARR
|
---|
| 48 | S IBDFSEL=$P(IBDFNODE,"^",4)
|
---|
| 49 | S IBDCNT=IBDCNT+1,VALMCNT=VALMCNT+1
|
---|
| 50 | S X=""
|
---|
| 51 | S IBDFVAL=$P(IBDFNODE,"^",1)
|
---|
| 52 | S X=$$SETSTR^VALM1(IBDFVAL,X,7,7)
|
---|
| 53 | S IBDFVAL=$P(IBDFNODE,"^",6)
|
---|
| 54 | S X=$$SETSTR^VALM1(IBDFVAL,X,16,5)
|
---|
| 55 | S IBDFVAL=$P(IBDFNODE,"^",2)
|
---|
| 56 | S X=$$SETSTR^VALM1(IBDFVAL,X,23,40)
|
---|
| 57 | S IBDFVAL=$P(^IBE(357.4,$P(IBDFNODE,"^",5),0),"^",1)
|
---|
| 58 | S X=$$SETSTR^VALM1(IBDFVAL,X,64,15)
|
---|
| 59 | TMP ; -- Set up TMP Array
|
---|
| 60 | S ^TMP("GRP",$J,IBDCNT,0)=X,^TMP("GRP",$J,"IDX",VALMCNT,IBDCNT1)=IBDFSEL
|
---|
| 61 | S ^TMP("GRPIDX",$J,IBDCNT1)=VALMCNT_"^"_$P(IBDFARR,"^",3)_"^"_$P(IBDFARR,"^",4)_"^"_$P(IBDFARR,"^",5) ;_"^"_IBDFX_"^"_$P(IBDFTMP,"^",4)_"^"_$P(IBDFTMP,"^",5)_"^"_$P(IBDFTMP,"^",1)_"^"_$P(IBDFTMP,"^",2)
|
---|
| 62 | Q
|
---|
| 63 | HEADER ; -- Set up header line for the display
|
---|
| 64 | S IBDCNT1=IBDCNT1+1
|
---|
| 65 | S IBDCNT=IBDCNT+1,VALMCNT=VALMCNT+1
|
---|
| 66 | S X=""
|
---|
| 67 | S IBDVAL=$S($P(IBDFARR,"^",2)]"":$P(IBDFARR,"^",2),1:"BLANK")
|
---|
| 68 | S IBDFHDR(IBDVAL)=IBDCNT1_"^"_$P(IBDFARR,"^",5)
|
---|
| 69 | S IBDFSEL=$P(IBDFARR,"^",5)
|
---|
| 70 | S X=$$SETSTR^VALM1(IBDCNT1_")",X,1,5) D TMP
|
---|
| 71 | S X="",IBDCNT=IBDCNT+1,VALMCNT=VALMCNT+1
|
---|
| 72 | S IBDVAL=$P(IBDFARR,"^",6)
|
---|
| 73 | S X=$$SETSTR^VALM1(IBDVAL,X,16,5)
|
---|
| 74 | S IBDVAL=$P(IBDFARR,"^",2)
|
---|
| 75 | S IBDVAL1=$L(IBDVAL) S IBDVAL1=(80-IBDVAL1)/2 S IBDVAL1=IBDVAL1\1 S X=$$SETSTR^VALM1(" ",X,22,IBDVAL1)
|
---|
| 76 | S X=$$SETSTR^VALM1(IBDVAL,X,IBDVAL1,25) D TMP,CNTRL^VALM10(VALMCNT,1,80,IOINHI,IOINORM,0)
|
---|
| 77 | S X="",IBDCNT=IBDCNT+1,VALMCNT=VALMCNT+1
|
---|
| 78 | S X=$$SETSTR^VALM1(" ",X,1,3) D TMP
|
---|
| 79 | Q
|
---|
| 80 | INTER ; -- Find Package interface for selection list
|
---|
| 81 | K IBARRY S IBDFAR="IBARRY",IBDFINT=$P($G(^IBE(357.2,IBLIST,0)),"^",11),IBDFINT(1)=$P(^IBE(357.6,IBDFINT,0),"^",1) D GETLST^IBDFQSL2(IBFORM,IBBLK,IBLIST,.IBDFINT,"IBARRY",1)
|
---|
| 82 | Q
|
---|
| 83 | HELP ; -- help code
|
---|
| 84 | S X="?" D DISP^XQORM1 W !!
|
---|
| 85 | Q
|
---|
| 86 | ;
|
---|
| 87 | EXIT ; -- exit code
|
---|
| 88 | K IBARRY,IBDFAR,IBDFARR,IBDFHDR,IBDFINT,IBDFSEL,IBDFVAL,IBDFX,IBDLSTNM,IBDVAL,IBDVAL1,IBLIST,IBRTN,IEN,IBLSNODE,DIC,IBGRP,NODE,IBDFNEW,IBDFOLD
|
---|
| 89 | K ^TMP("SEL",$J),^TMP("SELIDX",$J)
|
---|
| 90 | Q
|
---|
| 91 | ;
|
---|
| 92 | EXPND ; -- expand code
|
---|
| 93 | Q
|
---|
| 94 | ;
|
---|
| 95 | GRPCOPY ; -- COPY GROUP
|
---|
| 96 | N IBDVALM,GRP,VALMY,FROM,TO,IBDFCPYE
|
---|
| 97 | S IBDFCPYF=1
|
---|
| 98 | S (FROM,TO)="357.4"
|
---|
| 99 | S VALMBCK=""
|
---|
| 100 | D EN^VALM2($G(XQORNOD(0)))
|
---|
| 101 | I $O(VALMY(0)) D
|
---|
| 102 | .S IBDVALM=0
|
---|
| 103 | .D FULL^VALM1 S VALMBCK="R"
|
---|
| 104 | .F IBDVALM=0:0 S IBDVALM=$O(VALMY(IBDVALM)) Q:'IBDVALM S (DA,GRP)=$P($G(^TMP("GRPIDX",$J,IBDVALM)),"^",4) D COPYGRP^IBDFU2A(GRP,IBLIST,NEWLIST,NEWBLOCK,FROM,TO)
|
---|
| 105 | K IBDFCPYF
|
---|
| 106 | Q
|
---|
| 107 | SELECT2() ;allows the user to select a form, then a block from it
|
---|
| 108 | S IBBLK=""
|
---|
| 109 | S IBFORM=$$SLCTFORM^IBDFU4(0)
|
---|
| 110 | I IBFORM D
|
---|
| 111 | .W !!,"NOW CHOOSE THE BLOCK TO COPY!",!
|
---|
| 112 | .S IBBLK=$$SLCTBLK^IBDFU8(IBFORM,IOSL)
|
---|
| 113 | Q IBBLK
|
---|