source: FOIAVistA/trunk/r/NOIS-FSC/FSCLMPES.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: 2.5 KB
Line 
1FSCLMPES ;SLC/STAFF-NOIS List Manager Protocol Edit Status ;5/14/97 10:16
2 ;;1.1;NOIS;;Sep 06, 1998
3 ;
4STATUS ; from FSCLMP
5 N CALLNUM,OK,OLDSTAT,REOPEN,STATUS
6 S CALLNUM=$$CALL^FSCLMPE1(FSCCNT)
7 S OLDSTAT=$$STATCALL^FSCESU(CALLNUM)
8 I '$$ACCESS(DUZ,CALLNUM,+OLDSTAT) D Q
9 .W !,"You do not have access to change the status of this call." H 2
10 I 'OLDSTAT D STATUS^FSCES(CALLNUM,"",1) D UPDATE^FSCEU(CALLNUM) W !,"This call did not have a complete status. The status is now OPEN.",$C(7) H 2 Q
11 W !,"Current Status is ",$P(OLDSTAT,U,3)
12 S STATUS=+OLDSTAT
13 D ASK(.STATUS,.REOPEN,.OK)
14 I 'OK Q
15 I STATUS=2 D RES^FSCLMPE1 Q
16 I REOPEN D REOPEN(.OK) I 'OK Q
17 I REOPEN D GOODWKLD^FSCEWKLD(CALLNUM)
18 D STATUS^FSCES(CALLNUM,+OLDSTAT,STATUS,REOPEN)
19 I STATUS=6 D PATCH(CALLNUM,.OK) I 'OK D UPDATE^FSCEU(CALLNUM) Q
20 D NOTE(.OK) I OK D
21 .N OPER
22 .D DATA^FSCEN("ACTION",.OPER)
23 .I OPER="TIMEOUT" Q
24 .I OPER="QUIT" Q
25 .I OPER="ACCEPT" D NOTE^FSCEF(CALLNUM,"ACTION")
26 I STATUS=99 D BADWKLD^FSCEWKLD(CALLNUM)
27 E D WKLD^FSCEWKLD(CALLNUM,1)
28 D UPDATE^FSCEU(CALLNUM)
29 Q
30 ;
31ACCESS(USER,CALL,STATUS) ; $$(user,call,status) -> 1 to allow editing else 0
32 I $$ACCESS^FSCU(USER,"SPEC") Q 1
33 I '(STATUS=2!(STATUS=99)) Q 0
34 I USER=$P($G(^FSCD("CALL",CALL,0)),U,6) Q 1
35 I USER=$P($G(^FSCD("CALL",CALL,120)),U,20) Q 1
36 Q 0
37 ;
38PATCH(DA,OK) ;
39 N DIE,DR,X,Y S OK=1
40 S DIE="^FSCD(""CALL"",",DR=7
41 D ^DIE
42 I $D(DTOUT) S OK=0
43 Q
44 ;
45NOTE(OK) ;
46 N DIR,X,Y K DIR S OK=0
47 S DIR(0)="YAO",DIR("A")="Include a note with this status change? ",DIR("B")="NO"
48 S DIR("?",1)="Enter YES to make a note on this call."
49 S DIR("?",2)="Enter NO change the status without making a note."
50 S DIR("?")="^D HELP^FSCU(.DIR)"
51 S DIR("??")="FSC U1 NOIS"
52 D ^DIR K DIR
53 I $D(DIRUT) Q
54 I Y=1 S OK=1
55 Q
56 ;
57ASK(STATUS,REOPEN,OK) ;
58 N DIC,X,Y K DIC
59 S (OK,REOPEN)=0
60 I '$G(STATUS) Q
61 I STATUS=2!(STATUS=99) S (OK,REOPEN,STATUS)=1 Q ; closed or cancelled can only be reopened
62 S DIC=7106.1,DIC(0)="AEMOQ",DIC("A")="Select Status: "
63 S DIC("S")="I $D(^FSC(""STATUS"",STATUS,1,""B"",+Y))"
64 D ^DIC K DIC
65 I Y<1 Q
66 S OK=1,STATUS=+Y
67 Q
68 ;
69REOPEN(OK) ;
70 N DIR,X,Y K DIR S OK=0
71 S DIR(0)="YAO",DIR("A")="Are you sure you want to REOPEN this call? ",DIR("B")="NO"
72 S DIR("?",1)="Enter YES to reopen this call. The status will return to open"
73 S DIR("?",2)="allowing editing, referrals, etc."
74 S DIR("?",3)="Enter NO or '^' to exit without reopening the call, '??' for more help."
75 S DIR("?")="^D HELP^FSCU(.DIR)"
76 S DIR("??")="FSC U1 NOIS"
77 D ^DIR K DIR
78 I $D(DIRUT) Q
79 I Y=1 S OK=1
80 Q
Note: See TracBrowser for help on using the repository browser.