source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDWLE2.m@ 623

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1SDWLE2 ;;IOFO BAY PINES/TEH - WAITING LIST-ENTER/EDIT;06/12/2002 ; 20 Aug 2002 2:10 PM ; Compiled May 25, 2007 16:37:21
2 ;;5.3;scheduling;**263,397,424,446**;AUG 13 1993;Build 77
3 ;
4 ;
5 ;******************************************************************
6 ; CHANGE LOG
7 ;
8 ; DATE PATCH DESCRIPTION
9 ; ---- ----- -----------
10 ; 06/06/06 SD*5.3*446 Allow selection of a clinic after specialty is entered
11 ;
12 ;
13 ;
14 ;Service/Specialty sub-routine
15 ;
16EN ;
17 N SDWLSSX ; sd/446
18 K DIR,DIC,DR I $D(SDWLSS) S X=$$EXTERNAL^DILFD(409.3,7,,SDWLSS)
19 S SDWLERR=0 I $D(SDWLSS) S DIC("B")=$S($D(SDWLSS):X,1:"") I DIC("B")="" K DIC("B")
20 S DIC(0)="AEQ",DIC=409.31,DIC("A")="Select Service/Specialty: "
21 S DIC("S")="I $D(^SDWL(409.31,""E"",SDWLINE,+Y)),$D(^SDWL(409.31,+Y,""I"")),$P(^SDWL(409.31,+Y,""I"",($O(^SDWL(409.31,+Y,""I"",""B"",SDWLINE,""""))),0),U,4)=""""" D ^DIC
22 I X["^" S DUOUT=1 G END
23 I Y<0 W *7," Required" G EN
24 S SDWLSSX=+Y ; sd/446
25 N SDSP S SDSP=$$GET1^DIQ(409.31,SDWLSSX,.01,"I") ; get pointer to 40.7
26 N SDD,SDCL,SDORG S SDCL="",SDORG=DT S SDD=$$CHKENC^SDWLQSC1(DFN,SDORG,SDCL,SDSP,1)
27 I SDD D APPTDIS N DIR,Y D I Y["^"!'Y S DUOUT=1 Q
28 .W !!,"This patient already has scheduled appointments which may match",!,"the Wait List Entry."
29 .S DIR(0)="Y^A0",DIR("B")="NO",DIR("A")="Are you sure you want to continue"
30 .D ^DIR
31 ;
32 I '$$CLIN() Q:$G(DUOUT) S DIE="^SDWL(409.3,",DR="7////^S X=SDWLSSX" D ^DIE ; sd/446
33 K DIR,DIC,DIE,DR,Y,DUOUT
34END Q
35APPTDIS ;display already created appt/encounters
36 ;from ^TMP($J,"APPT")
37 N STR,SCNT
38 Q:'$D(^TMP($J,"APPT"))
39 S SCNT="" F S SCNT=$O(^TMP($J,"APPT",SCNT)) Q:SCNT="" D
40 .S STR=^TMP($J,"APPT",SCNT)
41 .N ZZ F ZZ=2,3,4,10,15 S SDD(ZZ)=$P($P(STR,"^",ZZ),";",2)
42 .N SD S SD=$P(STR,U) D S Y=SD D D^DIQ S SDD(1)=Y ; date conv
43 ..I SDD(3)="SCHEDULED/KEPT" S SDD(3)=$S(SD<DT:"KEPT",1:"SCHEDULED")
44 .;DISPLAY
45 .I SCNT=1 D DPH(SCNT,.SDD)
46 .D DPHD(SCNT,.SDD)
47 Q
48DPH(SCNT,SDD) ;display appt header
49 W !!,"Appointment(s) for: "_SDD(4)
50 W !?3,"Appt Date/Time",?23,"Clinic",?48,"Status",?60,"Institution",! N SDL S $P(SDL,"-",79)="" W SDL,!
51 Q
52DPHD(SCNT,SDD) ;
53 W !,SCNT,?3,SDD(1),?23,$E(SDD(2),1,23),?48,$E(SDD(10),1,10),?60,SDD(15)
54 Q
55 ;
56CLIN() ; sd/446
57 N DA,DIC,DIE,DIK,DR,SDWLCL,SDWLEST,X,Y
58 S DIC=409.32,DIC(0)="AEQ",DIC("A")="WL SPECIFIC CLINIC related to this SPECIALTY (optional): ",DIC("S")="I $$VAL^SDWLE2(+Y)"
59 D ^DIC
60 I X["^" S DUOUT=1 Q 0
61 Q:X="" 0
62 S SDWLCL=+Y
63 ; Need to delete the old entry and create anew to change the wait list type
64 S SDWLEST=$$GET1^DIQ(409.3,SDWLDA,27,"I")
65 S DIK="^SDWL(409.3,",DA=SDWLDA
66 D ^DIK
67 S DIC(0)="LX",X=SDWLDFN,DIC="^SDWL(409.3," D FILE^DICN
68 L:DA'=SDWLDA +^SDWL(409.3,DA),-^SDWL(409.3,SDWLDA)
69 S SDWLDA=DA
70 S DIE="^SDWL(409.3,",DR="1////^S X=DT;2////^S X=SDWLINE;4////^S X=4;8////^S X=SDWLCL;9////^S X=DUZ;27////^S X=SDWLEST"
71 S:$G(SDWLACA) DR=DR_";33////^S X=""Y""" ; 446
72 D ^DIE
73 Q 1
74VAL(Y) ; sd/446
75 N TMP
76 D GETS^DIQ(409.32,Y,".01;.02;2;4","I","TMP")
77 Q:TMP(409.32,Y_",",.02,"I")'=SDWLINE 0 ; Wrong institution
78 Q:TMP(409.32,Y_",",2,"I")="" 0 ; No activation date entered
79 Q:TMP(409.32,Y_",",4,"I")'="" 0 ; Inactivation date entered
80 Q $$GET1^DIQ(44,TMP(409.32,Y_",",.01,"I"),8,"I")=$$GET1^DIQ(409.31,SDWLSSX,.01,"I") ; Does the clinic have the right stop code?
Note: See TracBrowser for help on using the repository browser.