source: WorldVistAEHR/trunk/r/AUTOMATED_INFO_COLLECTION_SYS-IBD/IBDFU4.m@ 1800

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1IBDFU4 ;ALB/CJM - ENCOUNTER FORM - BUILD FORM(write single form block to array for display,position & size copied block) ; 08-JAN-1993
2 ;;3.0;AUTOMATED INFO COLLECTION SYS;**10**;APR 24, 1997
3 ;
4IDXBLOCK ; create list containing block rows for list processor
5 ;
6 N I
7 W !,"... BUILDING THE FORM BLOCK ..."
8 Q:$$BLKDESCR^IBDFU1B(.IBBLK)
9 ;
10 ;keep small blocks in memory
11 ;I ((IBBLK("H")+1)*(IBBLK("W")+1))<4000 S VALMAR="IBMEMARY"
12 ;
13 K @VALMAR D KILL^VALM10()
14 D BLNKFORM^IBDF5A(0,IBBLK("H")-1,IBBLK("W"))
15 S I="",$P(I,"~",IBBLK("W")+1)="~"
16 S @VALMAR@(IBBLK("H")+1,0)=" "_I
17 S VALMCNT=IBBLK("H")+1
18 D DRWBLOCK^IBDF2A1(.IBBLK,1)
19 Q
20POS(NEWBLOCK,DFLTX,DFLTY) ;allows the user to position and size the block
21 ;NEWBLOCK = block to be edited
22 ;DFLTY - default value for starting row
23 ;DFLTX - default value for starting column
24 N IBX,IBY ;used in the input template
25 S:$G(DFLTX)=+$G(DFLTX) $P(NODE,"^",5)=DFLTX
26 S:$G(DFLTY)=+$G(DFLTY) $P(NODE,"^",4)=DFLTY
27 N NODE,IBBLK,IBDONE
28 S IBBLK=NEWBLOCK
29 S NODE=$G(^IBE(357.1,NEWBLOCK,0))
30 ;set defaults for starting column, starting row
31 S ^IBE(357.1,NEWBLOCK,0)=NODE,IBDONE=0
32 K DIE S DIE=357.1,DA=NEWBLOCK,DR="[IBDF POSITION COPIED BLOCK]"
33 D ^DIE K DIE,DR,DA
34 I 'IBDONE D DLTBLK^IBDFU3(NEWBLOCK,IBFORM,357.1)
35 Q
36CURX() ;returns the current X position (top left corner of displayed poriton of the form - internal column value)
37 N IB
38 S IB=+$G(VALMLFT),IB=IB-5 S:IB<0 IB=0
39 Q IB
40CURY() ;returns the current Y position (top left corner of displayed poriton of the form - internal row value)
41 N IB
42 S IB=+$G(VALMBG),IB=IB-1 S:IB<0 IB=0
43 Q IB
44SLCTFORM(TK,NODE) ;allows the user to select a form and returns the IEN
45 ;returns 0 if no form selected
46 ;
47 ;INPUTS
48 ;if TK=0 assumes form should not be a toolkit form
49 ;if TK=1 assumes form should be a toolkit form
50 ;otherwise, ask the user if the he wants to select fromt he toolkit
51 ;
52 ;NODE is optional - if defined it returns the 0 node of the form selected - should be passed by reference
53 ;
54 N FORM,Y S FORM=0
55 S TK=$G(TK)
56 I TK'=0,TK'=1 D
57 .K DIR S DIR(0)="YA",DIR("A")="Do you want to select a form from the toolkit? "
58 .D ^DIR
59 .I Y'=-1,'$D(DIRUT) S TK=Y
60 ;don't continue with the selection if it is not known whether or not the form is comming from the toolkit
61 I (TK=1)!(TK=0) D
62 .D:$G(IBDEVICE("LISTMAN")) FULL^VALM1
63 .K DIC S DIC("S")=$S(TK:"I $P($G(^(0)),U,7),$P($G(^(0)),U)'=""TOOL KIT"",$P($G(^(0)),U)'=""WORKCOPY"",$P($G(^(0)),U)'=""DEFAULTS""",1:"I '$P($G(^(0)),U,7)"),DIC=357,DIC(0)="AEQ"_$S($D(NODE):"Z",1:"")
64 .S DIC("A")="Select a FORM: "
65 .D ^DIC S:+Y>0 FORM=+Y
66 I FORM,$D(NODE) S NODE=Y(0)
67 K DIC,Y,DIR
68 Q FORM
69CLINICS(FORM,ARY) ;finds the list of clinics using FORM
70 ;@ARY@(0) is set to the number of clinics found
71 ;ARY is where to put the list of clinics
72 ;
73 N CLINIC,SETUP,IDX,COUNT,NAME
74 K @ARY
75 S COUNT=0
76 F IDX="C","D","E","F","G","H","I","J" D
77 .S SETUP="" F S SETUP=$O(^SD(409.95,IDX,FORM,SETUP)) Q:'SETUP D
78 ..S CLINIC=$P($G(^SD(409.95,SETUP,0)),"^",1)
79 ..Q:'CLINIC
80 ..S NAME=$P($G(^SC(CLINIC,0)),"^",1)
81 ..Q:NAME=""
82 ..I '$D(@ARY@(NAME)) S @ARY@(NAME)=CLINIC,COUNT=COUNT+1
83 S @ARY@(0)=COUNT
84 Q
85LIST(ARY,SCRNSIZE) ;
86 ;ARY is the same as in CLINICS
87 N CLINIC,COUNT,DIR,DTOUT,DUOUT,DIRUT,DIROUT
88 S DIR(0)="YO",DIR("B")="Y",DIR("A")="List the clinics using the form"
89 D ^DIR K DIR I '$D(DIRUT),Y D
90 .S (COUNT,CLINIC)=0
91 .S DIR(0)="E"
92 .F S CLINIC=$O(@ARY@(CLINIC)) Q:CLINIC="" W !,CLINIC S COUNT=COUNT+1 I COUNT=SCRNSIZE D ^DIR Q:'Y S COUNT=0
93 .I '$D(DUOUT) D:COUNT>0 ^DIR
94 Q
Note: See TracBrowser for help on using the repository browser.