1 | DVBCMKLK ;ALB/GTS-AMIE C&P APPT EVENT DRIVER-LINK RTN ; 10/20/94 4:00 PM
|
---|
2 | ;;2.7;AMIE;;Apr 10, 1995
|
---|
3 | ;
|
---|
4 | ;** NOTICE: This routine is part of an implementation of a Nationally
|
---|
5 | ;** Controlled Procedure. Local modifications to this routine
|
---|
6 | ;** are prohibited per VHA Directive 10-93-142
|
---|
7 | ;
|
---|
8 | ;** Version Changes
|
---|
9 | ; 2.7 - New routine (Enhc 13)
|
---|
10 | ;
|
---|
11 | EN ;** Link C&P appointment to 2507
|
---|
12 | S DVBADFN=DFN,DVBASTAT="P" ;**DVBASTAT used in REQARY^DVBCUTL5
|
---|
13 | ;
|
---|
14 | ;**If user entered from AMIE Scheduling, only prompted if enhanced
|
---|
15 | ;** dialogue turned on and is needed
|
---|
16 | ;** QUIT on next line if from DVBCSCHD
|
---|
17 | I $D(DVBASDRT) S DVBADA=REQDA D LINKAPPT^DVBCMKL2,KVARS QUIT ;*DVBCSCHD
|
---|
18 | S (DVBADA,DVBASDPR)=""
|
---|
19 | D REQARY^DVBCUTL5 ;**Set up ^TMP of AMIE 2507's
|
---|
20 | I +DVBACNT>0 DO
|
---|
21 | .I +DVBACNT=1 DO ;**Auto select 2507 if only one exists
|
---|
22 | ..S (DVBADT,DVBADA,DVBAORD)=""
|
---|
23 | ..S DVBAORD=$O(^TMP("DVBC",$J,DVBAORD))
|
---|
24 | ..S DVBADT=$O(^TMP("DVBC",$J,DVBAORD,DVBADT))
|
---|
25 | ..S DVBADA=$O(^TMP("DVBC",$J,DVBAORD,DVBADT,DVBADA))
|
---|
26 | .I +DVBACNT>1 DO ;**If more than one 2507 exists, user select
|
---|
27 | ..D REQSEL^DVBCUTL5 ;**Select a 2507 from ^TMP
|
---|
28 | ..I (+Y'>0)!($D(DVBAOUT)) S DVBADA=""
|
---|
29 | ..S:+Y>0 DVBASEL=+Y ;**Y is selected 2507 val returned from ^DIR
|
---|
30 | ..D:+Y>0 FINDDA^DVBCUTL5 ;**Find selected 2507 DA (Returned in DVBADA)
|
---|
31 | .K ^TMP("DVBC",$J)
|
---|
32 | .I '$D(^DVB(396.3,+DVBADA,0)),(+$$ENHNC^DVBCUTA4=1) DO ;**Write warning
|
---|
33 | ..S DIR("A",1)="You have not selected a 2507 request to link the C&P appointment to."
|
---|
34 | ..S DIR("A",2)="The appointment should be linked with the AMIE/C&P Appointment Link"
|
---|
35 | ..S DIR("A",3)=" Management Option to ensure proper processing time calculation for this 2507"
|
---|
36 | ..S DIR("A",4)=" in the event of a veteran cancellation."
|
---|
37 | ..S DIR("A",5)=" "
|
---|
38 | ..S DIR(0)="FAO^1:1",DIR("A")="Hit any key to continue." D ^DIR K DIR,X,Y
|
---|
39 | .I $D(^DVB(396.3,+DVBADA,0)) D LINKAPPT^DVBCMKL2 ;**If 2507, link appt
|
---|
40 | I +DVBACNT'>0,(+$$ENHNC^DVBCUTA4=1) DO ;**Write Warning
|
---|
41 | .S DIR("A",1)="You have made a C&P appointment for a patient who has no pending 2507 request!"
|
---|
42 | .S DIR("A",2)=" "
|
---|
43 | .S DIR(0)="FAO^1:1",DIR("A")="Hit any key to continue." D ^DIR K DIR,X,Y
|
---|
44 | Q
|
---|
45 | ;
|
---|
46 | KVARS ;** Kill variables used by scheduling protocol
|
---|
47 | K DVBAMORE,DVBALP,DVBAOUT,DVBADTOT,DVBASDPR,DVBASEL
|
---|
48 | K DVBAPNAM,DVBADA,DVBADFN,DVBASTAT,DVBADT,DVBAORD,DVBACNT
|
---|
49 | K ^TMP("DVBC",$J),Y,DVBAYANS,DVBALKRC,DVBARSAP
|
---|
50 | Q
|
---|
51 | ;
|
---|
52 | CRTREC ;** Add a record to file 396.95 (Appt Tracking)
|
---|
53 | K DD,DO
|
---|
54 | S DVBAADT=$P(SDATA,U,3)
|
---|
55 | S DIC="^DVB(396.95,",X=DVBAADT,DIC(0)="LX",DLAYGO="396.95"
|
---|
56 | S DIC("DR")=".02////^S X=DVBAADT;.03////^S X=DVBAADT;"
|
---|
57 | S DIC("DR")=DIC("DR")_".04////^S X=0;.06////^S X=DVBADA;"
|
---|
58 | S DIC("DR")=DIC("DR")_".07////^S X=1"
|
---|
59 | D FILE^DICN K DIC,X,DLAYGO,DVBAADT
|
---|
60 | I +$$ENHNC^DVBCUTA4=1 DO
|
---|
61 | .N REQDT,SAVY
|
---|
62 | .S:$D(Y) SAVY=Y
|
---|
63 | .S REQDT=$$GETDTE(DVBADA) ;**Set REQDT
|
---|
64 | .S:$D(SAVY) Y=SAVY
|
---|
65 | .S DIR("A",1)=" "
|
---|
66 | .S DIR("A",2)="Adding new C&P appointment link for 2507 request dated "_REQDT_"."
|
---|
67 | .S DIR("A",3)=" "
|
---|
68 | .S DIR(0)="FAO^1:1",DIR("A")="Hit any key to continue." D ^DIR K DIR,X,Y
|
---|
69 | Q
|
---|
70 | ;
|
---|
71 | GETDTE(REQDA) ;** Get the request dte
|
---|
72 | N REQDT
|
---|
73 | K Y S Y=$P(^DVB(396.3,REQDA,0),U,2) X ^DD("DD")
|
---|
74 | S REQDT=Y
|
---|
75 | K Y
|
---|
76 | Q REQDT
|
---|
77 | ;
|
---|
78 | RSCHAPT(LKDA,RSCHDT) ;** Update Appt record with reschedule data
|
---|
79 | S DA=+LKDA,DIE="^DVB(396.95,",DR=".03////^S X=RSCHDT;.07////1"
|
---|
80 | S:(+$P(^DVB(396.95,DA,0),U,4)=0&('$D(DVBAVTRQ))) DR=".02////^S X=RSCHDT;"_DR
|
---|
81 | S:($D(DVBAVTRQ)) DR=".04////^S X=1;.05////^S X=RSCHDT;"_DR
|
---|
82 | D ^DIE K DA,DIE,DR
|
---|
83 | I +$$ENHNC^DVBCUTA4=1 DO
|
---|
84 | .N REQDT,SAVY
|
---|
85 | .S:$D(Y) SAVY=Y
|
---|
86 | .S REQDT=$$GETDTE($P(^DVB(396.95,LKDA,0),U,6)) ;**Set REQDT
|
---|
87 | .S:$D(SAVY) Y=SAVY
|
---|
88 | .S DIR("A",1)=" "
|
---|
89 | .S DIR("A",2)="Adjusting C&P appointment link for 2507 request dated "_REQDT_"."
|
---|
90 | .S DIR("A",3)=" "
|
---|
91 | .S DIR(0)="FAO^1:1",DIR("A")="Hit any key to continue." D ^DIR K DIR,X,Y
|
---|
92 | Q
|
---|