source: FOIAVistA/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDF13.m@ 1397

Last change on this file since 1397 was 628, checked in by George Lilly, 15 years ago

initial load of FOIAVistA 6/30/08 version

File size: 3.5 KB
Line 
1IBDF13 ;ALB/CJM - ENCOUNTER FORM - EDITING TOOLKIT BLKS ; 24-JUN-1993
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;;APR 24, 1997
3 ;
4LIST ;displays list of toolkit blocks, then allows editng
5 N IBFORM,IBTKFORM,IBTKBLK,IBFASTXT,IOVL,IOHL,IOBRC,IOBLC,IOTRC,IOTLC,IBBLK,BLKLIST,D0,DA,IBDEVICE
6 S (IBTKFORM,IBFASTXT,IBBLK)=0,IBTKBLK=1
7 S IBFORM("NAME")="LIST OF TOOLKIT BLOCKS",IBFORM("TOOLKIT")=1,IBFORM("COMPILED")=0,IBFORM("HT")=80,IBFORM("WIDTH")=133,IBFORM("PAGE_HT")=80,IBFORM("PAGES")=1,IBFORM("SCAN")=1,IBFORM("SCAN","ICR")=1,IBFORM("SCAN",1)=1
8 ;
9 D DEVICE^IBDFUA(1,.IBDEVICE)
10 K XQORS,VALMEVL
11 D PRNTPRMS^IBDFU1C(.IBPRINT,0,1,0,0)
12 S IBFORM=$$TKFORM^IBDFU2C
13 D EN^VALM("IBDF EDIT TOOL KIT BLOCKS") ;list processor displays list of toolkit blocks
14 Q
15 ;
16SELECT() ;allows the user to select from the displayed list of TK blocks
17 N CHOICE,IBBLK
18 S IBBLK=""
19 D EN^VALM2($G(XQORNOD(0)),"S")
20 S CHOICE=$O(VALMY("")) S:CHOICE IBBLK=$G(@VALMAR@("IDX",CHOICE,CHOICE))
21 Q IBBLK
22EDITBLK ;allows user to select a blk, then displays it for edit
23 ;allows user to discard or save changes to the block
24 ;
25 ;If IBBLK and IBBLK2 are used to point to two copies of the block, one in the workspace and the other on the form
26 ;the copy on the form is not edited, the copy in the workspace is
27 N IBBLK,IBBLK2,IBTKODR,IBJUNK,IFSAVE
28 ;N IBMEMARY
29 S VALMBCK="R"
30 S IBBLK2=""
31 S IBBLK=$$SELECT
32 I IBBLK D
33 .S (IBBLK2,IBTKODR,IBJUNK)=""
34 .D COPYBLK^IBDF5B(IBBLK,.IBBLK2,.IBBLK,.IBTKODR,.IBJUNK) I 'IBBLK S IBBLK=IBBLK2,IBBLK2="" Q ;sets IBBLK to the work copy, IBBLK2 to the copy actually on the form
35 D:IBBLK2 EN^VALM("IBDF FORM BLOCK EDIT")
36 I IBBLK,IBBLK2 D
37 .S IFSAVE=$$ASKSAVE^IBDF5B
38 .I IFSAVE D SAVECOPY^IBDF5B(.IBBLK,.IBBLK2,IBTKODR) S IBBLK=IBBLK2,IBBLK2=""
39 .I 'IFSAVE D DLTCOPY^IBDF5B(IBBLK) S IBBLK=IBBLK2,IBBLK2=""
40 S IBPRINT("WITH_DATA")=0
41 D:'$G(IBFASTXT) IDXBLKS^IBDF7
42 Q
43DLTBLOCK ;allows user to select a blk, then deletes it
44 N IBBLK
45 S VALMBCK="R"
46 S IBBLK=$$SELECT
47 I IBBLK Q:'$$RUSURE^IBDFU5($P($G(^IBE(357.1,IBBLK,0)),"^")) D DLTBLK^IBDFU3(IBBLK,IBFORM,357.1),IDXBLKS^IBDF7
48 Q
49CHGORDER ;allows user to select a blk, then change it's order in the toolkit
50 N IBBLK
51 S VALMBCK="R"
52 S IBBLK=$$SELECT
53 I IBBLK K DIE,DA S DIE=357.1,DA=IBBLK,DR=".14R" D ^DIE K DIE,DA,DR,DIC
54 D IDXBLKS^IBDF7
55 Q
56NEWBLK ;creates a new toolkit block
57 N IBBLK
58 S VALMBCK="R"
59 S IBBLK=$$CREATE^IBDF5C()
60 D:IBBLK IDXBLKS^IBDF7
61 Q
62COPYBLK ;allows the user to select a block to copy
63 N IBBLK,CHOICE,NEWBLK
64 S VALMBCK="R"
65 D FULL^VALM1
66 K DIR S DIR(0)="SO^1:ON THE LIST OF TOOLKIT BLOCKS;2:ON A TOOLKIT FORM;3:ON A FORM NOT IN THE TOOLKIT"
67 S DIR("A")="WHERE IS THE BLOCK THAT YOU WANT COPIED?"
68 D ^DIR K DIR
69 Q:(Y=-1)!$D(DIRUT)
70 S CHOICE=Y,IBBLK=""
71 D:CHOICE=1 RE^VALM4
72 S:CHOICE=1 IBBLK=$$SELECT
73 S:CHOICE=2 IBBLK=$$SELECT2(1)
74 S:CHOICE=3 IBBLK=$$SELECT2(0)
75 I IBBLK S NEWBLK=$$COPYBLK^IBDFU2(IBBLK,IBFORM,357.1,357.1,0,0,$$TKORDER()) I NEWBLK D
76 .K DIE,DA S DIE=357.1,DA=NEWBLK,DR=".01;.13R;.14R" D ^DIE
77 .I '$G(DA) D DLTCNTNT^IBDFU3(NEWBLK,357.1)
78 .K DIE,DA,DR,DIC
79 .D IDXBLKS^IBDF7
80 S VALMBCK="R"
81 Q
82TKORDER() ;returns an unused number for the list of toolkit blocks
83 N NUMBER
84 F NUMBER=1:1:10000 Q:'$D(^IBE(357.1,"D",NUMBER))
85 Q NUMBER
86SELECT2(TK) ;allows the user to select a form, then a block from it
87 ;TK=0 if form is not to be chosen from the TK
88 ;TK=1 if the form is to be chosen from the TK
89 ;TK="" means ask the user whether or not the form is in the TK
90 N IBFORM,IBBLK
91 S IBBLK=""
92 S IBFORM=$$SLCTFORM^IBDFU4($G(TK))
93 I IBFORM D
94 .W !!,"NOW CHOOSE THE BLOCK TO COPY!",!
95 .S IBBLK=$$SLCTBLK^IBDFU8(IBFORM,IOSL)
96 Q IBBLK
Note: See TracBrowser for help on using the repository browser.