source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SDC3.m@ 1688

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

initial load of FOIAVistA 6/30/08 version

File size: 1.4 KB
Line 
1SDC3 ;ALB/LDB - CANCELLATION LETTERS; 23-DEC-88@12:30
2 ;;5.3;Scheduling;**330,340,398**;Aug 13, 1993
3EN N SDBAD F L1=0:0 S L1=$O(^SC(+SC,"S",SD,1,L1)) Q:L1'>0 S A=+^(L1,0) D CHECK,SET:$D(SDOK)
4 Q
5CHECK K SDOK I $S('$D(^DPT(+A,.35)):1,$P(^DPT(+A,.35),"^",1)']"":1,1:0),$D(^DPT(+A,"S",SD)),$P(^DPT(+A,"S",SD,0),"^",2)="C"!($P(^(0),"^",2)="CA") S SDOK=1
6 D B I SDBAD K SDOK
7 Q
8SET S ^UTILITY("SDLT",$J,+SDLET,+A,SD,+SC)="" I $P(^DPT(+A,"S",SD,0),"^",2)="CA"&($P(^(0),"^",10)]"") S SD8=$P(^(0),"^",10) I $D(^DPT(+A,"S",SD8,0)),$P(^(0),"^",2)'["C" S ^UTILITY("SDLT",$J,+SDLET,"A",+A,SD8,+SC)=""
9 Q
10PR F SD1=0:0 S SD1=$O(^UTILITY("SDLT",$J,SD1)) Q:SD1="" S SDLET=SD1 D PR0
11 I $D(^TMP($J,"BADADD")) D BADADD^SDLT K ^TMP($J,"BADADD")
12 Q
13PR0 S S81=0 F SD8=0:0 D:SD8'=S81 PR1 S S81=SD8,SD8=$O(^UTILITY("SDLT",$J,SD1,SD8)) Q:SD8'>0 S A=SD8 D B Q:SDBAD D ^SDLT F S82=0:0 S S82=$O(^UTILITY("SDLT",$J,SD1,SD8,S82)) Q:S82'>0 S SDC=$O(^(S82,-1)),SDX=S82,S=^DPT(+A,"S",S82,0) D WRAPP^SDLT
14 K SD8,S81,S82
15 Q
16PR1 I $D(^UTILITY("SDLT",$J,SD1,"A",SD8)),A=SD8 W !!,"The cancelled appointments have been rescheduled as follows:",! D PR2
17 D REST^SDLT Q
18PR2 F SD82=0:0 S SD82=$O(^UTILITY("SDLT",$J,SD1,"A",SD8,SD82)),SDX=SD82 Q:SD82'>0 S SC=$O(^(SD82,-1)),S=^DPT(+A,"S",SD82,0) D WRAPP^SDLT
19 K SD82
20 Q
21 ;CHECK FOR BAD ADDRESS
22B S SDBAD=$$BADADR^DGUTL3(+A)
23 S:SDBAD ^TMP($J,"BADADD",$P(^DPT(+A,0),"^"),+A)=""
24 Q
Note: See TracBrowser for help on using the repository browser.