source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDWLD.m@ 1134

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

initial load of WorldVistAEHR

File size: 4.5 KB
Line 
1SDWLD ;;IOFO BAY PINES/TEH - DISPLAY PENDING APPOINTMENTS;06/12/2002 ; 20 Aug 2002 2:10 PM ; Compiled September 25, 2006 13:39:47
2 ;;5.3;scheduling;**263,454,417,446**;AUG 13 1993;Build 77
3 ;
4 ;
5 ;*********************************************************
6 ; CHANGE LOG
7 ;
8 ; DATE PATCH DESCRIPTION
9 ; ---- ----- -----------
10 ;
11 ;
12 ; ;ENTRY POINT FOR OPTION CALL
13 ;
14 ; SDWLDFN = PATIENT IEN
15 ; SDWLSSN = PATIENT SSN
16 ; SDWLNAM = PATIENT NAME
17 ;
18 ; ;Patch SD*5.3*417 Display Team when displaying Position.
19 ;
20EN(SDWLDFN,SDWLSSN,SDWLNAM,SDTP) ;ENTRY POINT - INTIALIZE VARIABLES
21 ;SDTP (optional) - EWL ENTRY STATUS
22 I $G(SDTP)="" S SDTP="O"
23 I SDTP'="O"&(SDTP'="C") Q ;
24 K ^TMP("SDWLD",$J) I $D(^SDWL(409.3,"B",SDWLDFN)) D
25 .D GETDATA(SDTP)
26 .Q:'SDWLCNT
27 .D HD1
28 .D DIS
29 .D HD2
30 .D DISPD
31 Q
32GETDATA(SDTP) ;GET PATIENT DATA FROM SD WAIT LIST FILE (^SDWL(409.3)
33 ;SDTP - EWL entry status
34 ; O - open
35 ; C - closed
36 N SDWLWTE S SDWLCNT=0,SDWLWTE=0 D
37 .I SDTP="C" N SDDENT,SDBEG,SDEND D SEL1(.SDDENT) D I +SDDENT=0 Q ;return 'begin^end' entry day
38 ..I +SDDENT=0 W !,"Entry Date range required for closed EWL selection" Q
39 ..S SDBEG=$P(SDDENT,U),SDEND=$P(SDDENT,U,2)
40 .S SDWLDA=0 F S SDWLDA=$O(^SDWL(409.3,"B",SDWLDFN,SDWLDA)) Q:SDWLDA="" D
41 ..S SDWLDATA=$G(^SDWL(409.3,SDWLDA,0))
42 ..;
43 ..I $P(SDWLDATA,U,17)'[SDTP Q
44 ..I $D(^SDWL(409.3,"ST",SDWLDA)) S SDWLWTE=1
45 ..I $D(^SDWL(409.3,"SP",SDWLDA)) S SDWLPOS=1
46 ..S SDWLDT=$P(SDWLDATA,U,2) I SDTP="C" I SDWLDT<SDBEG!(SDWLDT>SDEND) Q
47 ..S SDWLCL=$P(SDWLDATA,U,4) I SDWLDT="" Q
48 ..S SDWLCLN="" I $D(^SC(+SDWLCL,0)) S SDWLCLN=$E($P($G(^SC(SDWLCL,0)),U,2),1,6) I SDWLCLN="" Q
49 ..S SDWLCNT=SDWLCNT+1,^TMP("SDWLD",$J,SDWLDFN,SDWLCNT)=SDWLDATA_"~"_SDWLDA,^TMP("SDWLD",$J,"B",SDWLCNT,SDWLDFN,SDWLDT,SDWLDA)=""
50 ..K SDWLDATA
51 Q
52SEL1(SDDENT) K DIR,%DT(0) S SDWLDISC="",%DT="AE",%DT("A")="Start with Date Entered: " D ^%DT N SDWLBDT S SDWLBDT=Y I Y<1 S SDDENT="^" Q
53 S %DT(0)=SDWLBDT,%DT("A")="End with Date Entered: " D ^%DT D SEL1(.SDDENT):Y<1 S SDWLEDT=Y K %DT(0),%DT("A")
54 S SDDENT=SDWLBDT_U_SDWLEDT
55DIS ;DISPLAY PATIENT DATA
56 W !,?5,SDWLNAM,?35,SDWLSSN,!
57 I $G(SDTP)'="C" W !,"Patient Currently is on Waiting List for the Following",!
58 E W !,"Patient is on closed Waiting List for the Following",!
59 Q
60DISPD ;DISPLAY WAIT LIST DATA
61 S (SDWLDT,SDWLCNT,SDWLCN)=""
62 F S SDWLCNT=$O(^TMP("SDWLD",$J,SDWLDFN,SDWLCNT)) Q:SDWLCNT="" D
63 .S X=$G(^TMP("SDWLD",$J,SDWLDFN,SDWLCNT)),SDWLDA=$P(X,"~",2),SDWLIN=$P(X,U,3),SDWLCL=$P(X,U,4),SDWLTY=$P(X,U,5),SDWLPRI=$P(X,U,11)
64 .N SDWLDSP,SDWLSCO,SDWLSPO,SDWLSSO,SDWLSTO S SDWLDSP=$P(X,U,17)
65 .S SDWLDT=$P(X,U,2),SDWLTYN=$$EXTERNAL^DILFD(409.3,4,,SDWLTY),SDWLPRIN=$$EXTERNAL^DILFD(409.3,10,,SDWLPRI)
66 .S SDWLSTO=$P(X,U,22),SDWLSPO=$P(X,U,23),SDWLSSO=$P(X,U,24),SDWLSCO=$P(X,U,25)
67 .S SDWLST=$P(X,U,6),SDWLSP=$P(X,U,7),SDWLSS=$P(X,U,8),SDWLSC=$P(X,U,9),SDWLWR="" D
68 ..I SDWLST'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,5,,SDWLST)
69 ..I SDWLSTO["Y" S SDWLWR="OPEN"
70 ..;SD*5.3*417
71 ..I SDWLSP'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,6,,SDWLSP) D
72 ...I $D(^SCTM(404.57,SDWLSP)) S SDWLX=$P($G(^SCTM(404.57,SDWLSP,0)),U,2),SDWLX=$E($P($G(^SCTM(404.51,SDWLX,0)),U,1),1,10),SDWLWR=SDWLWR_" ("_SDWLX_")"
73 ..I SDWLSPO["Y" S SDWLWR="OPEN"
74 ..I SDWLSS'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,7,,SDWLSS)
75 ..I SDWLSSO["Y" S SDWLWR="OPEN"
76 ..I SDWLSC'="" S SDWLWR=$$EXTERNAL^DILFD(409.3,8,,SDWLSC)
77 ..I SDWLSCO["^" S SDWLWR="OPEN"
78 .N YY,MM,DD S YY=$E(SDWLDT,1,3)+1700,YY=$E(YY,3,4),MM=$E(SDWLDT,4,5),DD=$E(SDWLDT,6,7),SDWLDTP=MM_DD_YY
79 .S SDWLCLN="" I $D(^SC(+SDWLCL,0)) S SDWLCLN=$$GET1^DIQ(44,SDWLCL_",",1,,)
80 .S SDWLINN=$E($P($G(^DIC(4,+SDWLIN,0)),U,1),1,8)
81 .N SDWLDIS S SDWLDIS=$P($G(^SDWL(409.3,SDWLDA,"DIS")),U,3),SDWLDISN=$$EXTERNAL^DILFD(409.3,21,,SDWLDIS)
82 .S SDWLCN=SDWLCN+1
83 .W !,$J(SDWLCN,2)_".",?5,$E(SDWLTYN,1,14),?22,SDWLPRI,?25,$E(SDWLWR,1,19),?51,$E(SDWLINN,1,14) W:$D(SDWLDISC) ?67,SDWLDSP
84 .W ?73,SDWLDTP
85 K SDWLDT,SDWLIN,SDWLCL,SDWLTY,SDWLPRI,SDWLPRIN,SDWLTYN,SDWLST,SDWLSP,SDWLSS,SDWLSC,SDWLCLN,SDWLDTP,SDWLINN,SDWLDA,SDWLDISN
86 K SDWLPRI,SDWLWR
87 Q
88HD1 ;TOF HEADER INFORMATION
89 I '$D(SDWLHDR) S SDWLHDR="Wait List Display"
90 W !!,?80-$L(SDWLHDR_$S($D(SDWLOP):" - "_SDWLOP,1:""))\2,SDWLHDR W:$D(SDWLOP) " - ",SDWLOP ;SD*5.3*454 removed page feed
91 W !
92 Q
93HD2 ;DATA HEADER
94 W !," #",?4,"Wait List Type",?22,"P",?26,"Waiting",?51,"Institution" W:$D(SDWLDISC) ?65,"Status"
95 W ?74,"Date"
96 W !,?28,"For",?73,"Entered"
97 Q
Note: See TracBrowser for help on using the repository browser.