source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDWLAHRC.m@ 1270

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

initial load of WorldVistAEHR

File size: 3.8 KB
Line 
1SDWLAHRC ;;IOFO BAY PINES/TEH - EWL REPORT - COMPILE;06/12/2002 ; 20 Aug 2002 2:10 PM
2 ;;5.3;scheduling;**419**;AUG 13 1993;Build 16
3 ;
4 ;
5 ;
6 ;
7 ;
8 ;
9 ;
10 ;
11 ;
12 ;=====================================================================================
13 ; NOTES
14 ;=====================================================================================
15 ;
16 ;
17 ;
18 ;
19 ;
20 Q
21COM ;START OF COMPILE - GET FIRST SORT
22 N %H,DA
23 S (SDWL0,SDWL1,SDWL2,SDWL3,SDWL4)="" K SDWLST
24 F S SDWL0=$O(^XTMP("SDWLAHR",SDWLJOB,SDWL0)) Q:SDWL0<1 D
25 .F S SDWL1=$O(^XTMP("SDWLAHR",SDWLJOB,SDWL0,SDWL1)) Q:SDWL1="" D
26 ..S SDWLTY=""
27 ..I SDWL1["DAT" S SDWLTY="DAT"
28 ..I SDWL1["NUM" S SDWLTY="NUM"
29 ..I SDWL1["FT" S SDWLTY="FT"
30 ..I SDWL1["RS" S SDWLTY="RS"
31 ..I SDWL1["PRT" S SDWLTY="PRT"
32 ..I SDWL1["ANM" S SDWLTY="ANM"
33 ..I SDWLTY="" S SDWLTY="ERR"
34 ..F S SDWL2=$O(^XTMP("SDWLAHR",SDWLJOB,SDWL0,SDWL1,SDWL2)) Q:SDWL2="" D
35 ...F S SDWL3=$O(^XTMP("SDWLAHR",SDWLJOB,SDWL0,SDWL1,SDWL2,SDWL3)) Q:SDWL3="" D
36 ....S SDWLX=$G(^XTMP("SDWLAHR",SDWLJOB,SDWL0,SDWL1,SDWL2,SDWL3))
37 ....I SDWLTY["FT" S SDWL4="" F S SDWL4=$O(^XTMP("SDWLAHR",SDWLJOB,SDWL0,SDWL1,SDWL2,SDWL3,SDWL4)) Q:SDWL4="" D
38 .....S SDWLX=$G(^XTMP("SDWLAHR",SDWLJOB,SDWL0,SDWL1,SDWL2,SDWL3,SDWL4))
39 ....S SDWLST(SDWL0,SDWL2,SDWLX,SDWL1)=""
40 D CHK
41 D PRT
42 K PG,S,SDWL0,SDWL1,SDWL2,SDWL3,SDWL4,SDWLA,SDWLBDT,SDWLEDT,SDWLIEN,SDWLIENS,SDWLJOB,SDWLMN,SDWLMX,SDWLNM,SDWLOK
43 K SDWLR,SDWLTY,X,Y
44 Q
45CHK ;GET SORT LOGICAL
46 S SDWLIEN=0 F S SDWLIEN=$O(^SDWL(409.3,SDWLIEN)) Q:SDWLIEN<1 D D SET1
47 .S (SDWL0,SDWL1,SDWL2,SDWL3)=""
48 .F S SDWL0=$O(SDWLST(SDWL0)) Q:SDWL0<1 D
49 ..S SDWLOK(SDWL0)=0
50 ..F S SDWL1=$O(SDWLST(SDWL0,SDWL1)) Q:SDWL1="" D
51 ...F S SDWL2=$O(SDWLST(SDWL0,SDWL1,SDWL2)) Q:SDWL2="" D
52 ....F S SDWL3=$O(SDWLST(SDWL0,SDWL1,SDWL2,SDWL3)) Q:SDWL3="" D
53 .....S SDWLNM="ZZ",SDWLTY=$S(SDWL3["PRT":"PRT",SDWL3["DAT":"DAT",SDWL3["RS":"RS",SDWL3["FT":"FT",SDWL3["NUM":"NUM",SDWL3["ANM":"ANM",1:"") D CHK1
54 Q
55CHK1 ;CHECK EWL PATIENT FILE
56 I $D(SDWLTY),SDWLTY="FT" D Q
57 .S SDWLIENS=SDWLIEN_",",X=$$GET1^DIQ(409.3,SDWLIENS,SDWL1,"I") D
58 ..I X[SDWL2 S SDWLOK(SDWL0)=1
59 I $D(SDWLTY),SDWLTY="NUM" D Q
60 .S SDWLNM=$P(SDWL2,U),SDWLMX=$P(SDWL2,U,2),SDWLIENS=SDWLIEN_",",X=$$GET1^DIQ(409.3,SDWLIENS,SDWL1,"I") D
61 ..I X'<SDWLMN&(X'>SDWLMX) S SDWLOK(SDWL0)=1
62 I $D(SDWLTY),SDWLTY="DAT" D Q
63 .S SDWLBDT=$P(SDWL2,U),SDWLEDT=$P(SDWL2,U,2),SDWLIENS=SDWLIEN_",",X=$$GET1^DIQ(409.3,SDWLIENS,SDWL1,"I") D
64 ..I X'<SDWLBDT&(X'>SDWLEDT) S SDWLOK(SDWL0)=1
65 I $D(SDWLTY),SDWLTY="RS" D Q
66 .S SDWLIENS=SDWLIEN_",",X=$$GET1^DIQ(409.3,SDWLIENS,SDWL1,"I") I SDWL2=X S SDWLOK(SDWL0)=1
67 I $D(SDWLTY),SDWLTY="PRT" D Q
68 .S SDWLIENS=SDWLIEN_",",X=$$GET1^DIQ(409.3,SDWLIENS,SDWL1,"I") I SDWL2=X S SDWLOK(SDWL0)=1
69 I $D(SDWLTY),SDWLTY="ANM" D Q
70 .S SDWLIENS=SDWLIEN_",",X=$$GET1^DIQ(409.3,SDWLIENS,SDWL1,"I"),SDWLNM=$$GET1^DIQ(2,X_",","NAME","I") S SDWLOK(SDWL0)=1
71 Q
72SET1 ;
73 S SDWLR=0,SDWLOK=1 F S SDWLR=$O(SDWLOK(SDWLR)) Q:SDWLR<1 D
74 .S S=SDWLOK(SDWLR) I 'S S SDWLOK=0
75 I SDWLOK S ^XTMP("SDWLAHR",SDWLJOB,"LIST",SDWLNM,SDWLIEN)="",SDWL4=SDWL4+1
76 Q
77PRT S PG=0 D HD
78 S SDWLA=0,SDWLNM="" K SDWLSTOP
79 F S SDWLNM=$O(^XTMP("SDWLAHR",SDWLJOB,"LIST",SDWLNM)) G END:$$S^ZTLOAD Q:SDWLNM="" D I $D(SDWLSTOP),'SDWLSTOP G END
80 .F S SDWLA=$O(^XTMP("SDWLAHR",SDWLJOB,"LIST",SDWLNM,SDWLA)) G END:$$S^%ZTLOAD Q:SDWLA<1 D I $D(SDWLSTOP),'SDWLSTOP G END
81 ..S DIC="^SDWL(409.3,",DA=SDWLA,DR=":" D EN^DIQ
82 ..I $Y>(IOSL-5) D:IOST["C-"
83 ...S DIR(0)="Y",DIR("A")="Do You Wish to Continue",DIR("B")="YES" D ^DIR D I Y D HD Q
84 ...S SDWLSTOP=Y
85 Q
86HD W:$D(IOF) @IOF
87 W !!,?80-$L("EWL CUSTOM AD HOC REPORT")\2,"EWL CUSTOM AD HOC REPORT",?65 S PG=PG+1 W "PAGE: ",PG,!
88 S %H=+$H D YX^%DTC W ?80-$L(Y)\2,Y,!!
89 Q
90END ;
91 K DIR,DIC,DR,DIE,SDWLERR,SDWLF,SDWLX,SDLFD,SDWLCTX,SDWLDAT,SDWLPROM,SDWLINST,SDWLI,SDWLTAG,SDWLY
92 Q
Note: See TracBrowser for help on using the repository browser.