source: WorldVistAEHR/trunk/r/GENERIC_CODE_SHEET-GEC/GECSUSEL.m@ 1308

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

initial load of WorldVistAEHR

File size: 4.1 KB
Line 
1GECSUSEL ;WISC/RFJ-utility selection ;01 Nov 93
2 ;;2.0;GCS;**2**;MAR 14, 1995
3 Q
4 ;
5 ;
6CODESHET(BATCH) ; select an existing code sheet
7 ; batch = only select code sheets for batch
8 N %,%Y,DIC,GECSBADA,GECSSUPR,X,Y
9 I $L(BATCH) S GECSBADA=+$O(^GECS(2101.1,"B",BATCH,0)) I 'GECSBADA W !,"BATCH ",BATCH," CANNOT BE FOUND IN FILE 2101.1." Q 0
10 W !!,$S($D(^XUSEC("GECS SUPER EDITOR",+$G(DUZ))):"-- You can select all code sheets created for this batch type --",1:"-- You may only select code sheets which you have created --")
11 I $D(^XUSEC("GECS SUPER EDITOR",DUZ)) S GECSSUPR=1
12 S DIC("S")="I $P(^(0),U,4)=""""!($P(^(0),U,4)="_DUZ_")!($G(GECSSUPR))"
13 I $G(GECSBADA) S DIC("S")=DIC("S")_",$P(^(0),U,3)="_GECSBADA
14 S DIC="^GECS(2100,",DIC(0)="QEAM",DIC("A")="Select CODE SHEET ID Number: " D ^DIC
15 I Y'>0 Q 0
16 Q +Y
17 ;
18 ;
19BATTYPE(DEFAULT,DONTASK) ; select batch type parameters
20 ; default set to batch default in lookup, if set to '- GECO' it
21 ; will ask to select a batch name containing '- GECO'
22 ; dontask set to lookup on batch without asking
23 ; return gecs("batch")=batch name
24 ; gecs("batda")=batch da number
25 ; gecs("sysid")=system identidier (ams, etc)
26 N %,%Y,DIC,X,Y
27 ;
28 K GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
29 S DIC="^GECS(2101.1,"
30 ;
31 ; default is set (not null), lookup batch type, do not ask
32 I $G(DONTASK),$L(DEFAULT),DEFAULT'="- GECO" D Q
33 . S DIC(0)="MNZ",X=DEFAULT D ^DIC I Y'>0 Q
34 . D BATCHECK
35 . I '$G(GECS("BATDA")) K GECS("BATDA"),GECS("BATCH"),GECS("SYSID") Q
36 . W !,"Batch Type: ",GECS("BATCH")
37 ;
38 ; ask batch type
39 I DEFAULT="- GECO" S DIC("S")="I $P(^(0),U)[""- GECO""",DEFAULT=""
40 I $L(DEFAULT) S DIC("B")=DEFAULT
41 S DIC(0)="AEQMZ" D ^DIC I Y'>0 Q
42 D BATCHECK
43 I '$G(GECS("BATDA")) K GECS("BATDA"),GECS("BATCH"),GECS("SYSID") Q
44 W !,"Batch Type: ",GECS("BATCH")
45 Q
46 ;
47 ;
48BATNOFMS ; select batch except for fms
49 N DONTASK
50 K GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
51 I $L($G(GECSSYS)) S DONTASK=1
52 F W ! D BATTYPE($G(GECSSYS),$G(DONTASK)) Q:'$G(GECS("BATDA")) D Q:$G(GECS("BATDA"))
53 . I GECS("SYSID")="FMS" W !,"*** FMS DOCUMENTS CANNOT BE SELECTED ***" K GECS("BATDA")
54 I '$G(GECS("BATDA")) K GECS("BATCH"),GECS("BATDA"),GECS("SYSID")
55 Q
56 ;
57 ;
58BATCHECK ; check selected batch and set up variables
59 ; y=selected batch; y(0)=data for selected batch
60 I $P(Y(0),"^",4)="" W !,"SYSTEM ID FOR BATCH TYPE ",$P(Y,"^",2)," HAS NOT BEEN ENTERED." Q
61 S GECS("BATDA")=+Y,GECS("BATCH")=$P(Y,"^",2),GECS("SYSID")=$P(Y(0),"^",4)
62 Q
63 ;
64 ;
65TRANTYPE(DEFAULT,DONTASK) ; ask transaction type-segment
66 ; default set to segment default in lookup
67 ; dontask set to lookup on segment without asking
68 ; gecs("batda")=batch da (from file 2101.1)
69 ; gecs("sysid")=system id (AMS)
70 ; return gecs("tt")=segment name
71 ; gecs("ttda")=segment da number
72 ; gecs("edit")=edit template name
73 ; gecsflag=1 to exit application
74 N %,%Y,DIC,X,Y
75 ;
76 K GECS("TT"),GECS("TTDA"),GECS("EDIT"),GECSFLAG
77 S DIC="^GECS(2101.2,",DIC("S")="I $P(^(0),U,4)="_GECS("BATDA")
78 ;
79 ; segment defined, look it up and quit
80 I $G(DONTASK),$L(DEFAULT) D Q
81 . S DIC(0)="MNZ",X=DEFAULT D ^DIC I Y'>0 S GECSFLAG=1 Q
82 . D TTCHECK
83 . I '$G(GECS("SEGDA")) S GECSFLAG=1
84 ;
85 ; ask for segment entry
86 I $L($G(SEGMENT)),$G(GECS("SYSID"))="AMS" S DIC("B")=DEFAULT
87 S DIC(0)="AEQMZ" D ^DIC I Y'>0 S GECSFLAG=1 Q
88 D TTCHECK
89 Q
90 ;
91 ;
92TTCHECK ; check selected transaction type and set up variables
93 ; y=selected entry; y(0)=data for selected entry
94 I $P(Y(0),"^",3)=""!($P(Y(0),"^",5)'="Y") W !,"THIS TRANSACTION TYPE ",$P(Y,"^",2)," IS NOT YET ",$S($P(Y(0),"^",5)'="Y":"ACTIVATED",1:"AVAILABLE") Q
95 I $P(Y(0),"^",4)="" W !,"THE BATCH TYPE FOR THIS TRANSACTION TYPE ",$P(Y,"^",2)," HAS NOT BEEN ENTERED." Q
96 I $P(Y(0),"^",2)="" W !,"THE INPUT TEMPLATE FOR THIS TRANSACTION TYPE ",$P(Y,"^",2)," IS MISSING." Q
97 S GECS("TTDA")=+Y,GECS("TT")=$P(Y,"^",2),GECS("EDIT")=$P(Y(0),"^",3)
98 Q
99 ;
100 ;
101BATCHSEL(GECSDICS) ; select batch number from file 2101.3
102 ; gecsdics=screen
103 N %,%Y,DIC,X,Y
104 S DIC="^GECS(2101.3,",DIC(0)="QEAM",DIC("A")="Select BATCH NUMBER: "
105 I GECSDICS'="" S DIC("S")=GECSDICS
106 W ! D ^DIC I Y'>0 Q 0
107 Q +Y
Note: See TracBrowser for help on using the repository browser.