source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDWLE7.m@ 940

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

initial load of FOIAVistA 6/30/08 version

File size: 3.1 KB
Line 
1SDWLE7() ;;IOFO BAY PINES/OG - WAITING LIST-ENTER/EDIT - MOVE EWL ENTRY ; Compiled August 14, 2007 11:18:43
2 ;;5.3;scheduling;**446**;AUG 13 1993;Build 77
3 ;
4 ; ******************************************************************
5 ; CHANGE LOG
6 ;
7 ; DATE PATCH DESCRIPTION
8 ; ---- ----- -----------
9 ;
10EN() ;
11 N SDWLERR,SDWLCM,SDWLIN1,SDWLOPT,SDWLSC1,SDWLSC1X
12 S (SDWLERR,SDWLOPT)=1,SDWLCM=""
13 F D @("P"_SDWLOPT) Q:'SDWLOPT
14 Q SDWLERR
15 ;
16P1 ; Institution
17 S DIR(0)="PAO^DIC(4,:EMNZ"
18 S DIR("A")="Select Institution: "
19 S DIR("B")=$$GET1^DIQ(4,SDWLIN,.01)
20 S DIR("S")="I $E(+Y,1,3)=$E(SDWLIN,1,3)"
21 D ^DIR
22 I Y<1 S SDWLOPT=0 Q
23 S SDWLIN1=+Y,SDWLOPT=2
24 Q
25P2 ; Clinic
26 N DIR,Y,SDWLI,SDWLSTOP,SDWLSTP1,TMP
27 S DIR(0)="PAO^SDWL(409.32,:EMNZ",DIR("A")="Select Clinic: "
28 S DIR("S")="I +Y'=SDWLSC,$P(^SC($$GET1^DIQ(409.32,+Y,.01,""I""),0),U,4)=SDWLIN1"
29 D ^DIR
30 I Y="^" S SDWLOPT=0 Q
31 I Y<1 S SDWLOPT=1 Q
32 S SDWLSCL=+Y,SDWLSC1X=$$GET1^DIQ(409.32,SDWLSCL,.01)
33 S SDWLSTOP=$$GET1^DIQ(44,$$GET1^DIQ(409.32,SDWLSC,.01,"I"),8,"I")
34 S SDWLSTP1=$$GET1^DIQ(44,$$GET1^DIQ(409.32,SDWLSCL,.01,"I"),8,"I")
35 I SDWLSTOP=SDWLSTP1 S SDWLOPT=3 Q
36 K DIR
37 S DIR(0)="Y"
38 S TMP(0)=1,TMP(1,0)=$$GET1^DIQ(409.32,SDWLSC,.01)_" and "_SDWLSC1X_" have different stop codes."
39 D COL80^SDWLIFT(.TMP) F SDWLI=1:1:TMP(0) S DIR("A",SDWLI)=TMP(SDWLI,0)
40 S DIR("A")="Do you want to proceed?"
41 S DIR("B")="NO" D ^DIR
42 S SDWLOPT=Y*3 ; +Y=0: SDWLOPT=0; Y=1: SDWLOPT=3
43 Q
44 ;
45P3 ; Comment
46 D P4^SDWLE6
47 Q
48 ;
49P4 ; Display data and confirm.
50 N DIR,SDWLTMP,SDWLORDT,SDWLSCPG,SDWLSCPR,SDWLDDT,SDWLEEST,Y
51 D GETS^DIQ(409.3,SDWLDA_",","1;14;15;22;27","I","SDWLTMP")
52 S SDWLORDT=SDWLTMP(409.3,SDWLDA_",",1,"I")
53 S SDWLSCPG=SDWLTMP(409.3,SDWLDA_",",14,"I")
54 S SDWLSCPR=SDWLTMP(409.3,SDWLDA_",",15,"I")
55 S SDWLDDT=SDWLTMP(409.3,SDWLDA_",",22,"I")
56 S SDWLEEST=SDWLTMP(409.3,SDWLDA_",",27,"I")
57 S DIR(0)="Y"
58 S DIR("A",1)="The following EWL entry will be created"
59 S Y=SDWLORDT D DD^%DT
60 S DIR("A",2)="Originating Date: "_Y
61 S DIR("A",3)="Institution: "_$$GET1^DIQ(4,SDWLIN1,.01)
62 S DIR("A",4)="Wait List Type: SPECIFIC CLINIC"
63 S DIR("A",5)="Clinic: "_SDWLSC1X
64 S Y=SDWLDDT D DD^%DT
65 S DIR("A",6)="Desired Date of Appointment: "_Y
66 S DIR("A",7)="Comments: "_SDWLCM
67 S DIR("A")="Continue?"
68 S DIR("B")="YES"
69 D ^DIR
70 S SDWLOPT=0
71 Q:'Y
72 I '$$UPDATE(SDWLDFN,SDWLORDT,SDWLIN,SDWLSCL,SDWLSCPG,SDWLSCPR,SDWLDDT,SDWLCM,SDWLEEST,SDWLDA) S SDWLOPT=3
73 Q
74UPDATE(SDWLDFN,SDWLORDT,SDWLIN,SDWLSCL,SDWLSCPG,SDWLSCPR,SDWLDDT,SDWLCM,SDWLEEST,SDWLDA) ; Create new EWL entry
75 N DA,DIC,DIE,DR,X
76 S DIC(0)="LX",X=SDWLDFN,DIC="^SDWL(409.3," D FILE^DICN
77 L +^SDWL(409.3,DA):1 ; This file has just been created. Is it neurotic to code for the possibility of a lock from elsewhere?
78 I '$T W !,"Unable to acquire a lock on the Wait List file" Q 0
79 S DIE=DIC
80 S DR="1////^S X=SDWLORDT"
81 S DR=DR_";2////^S X=SDWLIN"
82 S DR=DR_";4////^S X=4"
83 S DR=DR_";8////^S X=SDWLSCL"
84 S DR=DR_";9////^S X=DUZ"
85 S DR=DR_";14////^S X=SDWLSCPG"
86 S DR=DR_";15////^S X=SDWLSCPR"
87 S DR=DR_";22////^S X=SDWLDDT"
88 S DR=DR_";23////^S X=""O"""
89 S DR=DR_";25////^S X=SDWLCM"
90 S DR=DR_";27////^S X=SDWLEEST"
91 S DR=DR_";37////^S X=SDWLDA"
92 D ^DIE
93 L -^SDWL(409.3,DA)
94 S SDWLERR=0
95 Q 1
Note: See TracBrowser for help on using the repository browser.