source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDAMN.m@ 703

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

initial load of WorldVistAEHR

File size: 2.6 KB
RevLine 
[613]1SDAMN ;ALB/MJK - No-Show Appt Action ; 2/4/92
2 ;;5.3;Scheduling;**478**;Aug 13, 1993
3 ;
4EN ; -- protocol SDAM APPT NO-SHOW entry pt
5 ; input: VALMY := array entries
6 ;
7 N VALMY,SDI,SDAT,SDTIME,SDNSACT,DFN,SDCL,SDT,SDSTB,SDSTA,SDSTOP
8 S VALMBCK="",(SDNSACT,SDSTOP)=0
9 D SEL^VALM2 G ENQ:'$O(VALMY(0))
10 D FULL^VALM1 S VALMBCK="R",SDI=0
11 F S SDI=$O(VALMY(SDI)) Q:'SDI I $D(^TMP("SDAMIDX",$J,SDI)) K SDAT S SDAT=^(SDI) D Q:SDSTOP
12 .D NOW^%DTC S SDTIME=%
13 .W !,^TMP("SDAM",$J,+SDAT,0),!
14 .S DFN=+$P(SDAT,U,2),SDT=+$P(SDAT,U,3),SDCL=+$P(SDAT,U,4)
15 .S SDSTB=$$STATUS^SDAM1(DFN,SDT,SDCL,$G(^DPT(DFN,"S",SDT,0))) ; before status
16 .Q:'$$CHK
17 .S SDSTOP=$$NS(DFN,SDT,SDCL,SDTIME,.SDNSACT)
18 .S SDSTA=$$STATUS^SDAM1(DFN,SDT,SDCL,$G(^DPT(DFN,"S",SDT,0))) ; after status
19 .I 'SDNSACT,'$$UPD(SDSTB,SDSTA,SDAT,$G(CNSTLNK)) S SDNSACT=2
20 ; values for SDNSACT : 0 = no re-build
21 ; 1 = re-build because of re-book
22 ; 2 = re-build because after not for list
23 I SDNSACT,SDAMTYP="P" D BLD^SDAM1
24 I SDNSACT,SDAMTYP="C" D BLD^SDAM3
25ENQ Q
26 ;
27NS(DFN,SDT,SC,SDTIME,SDNSACT) ; execute no-show code
28 ; input: DFN := pt file ifn
29 ; SDT := d/t of appt
30 ; SC := clinic ifn
31 ; SDTIME := now
32 ; SDNSACT := ns processing flag
33 ; [return] := did user uparrow [ 0|no , 1|yes]
34 ;
35 N SDI,SDCP,SDYES,SDINP,SDLT1,SDLT,SDDT,SDMSG,A,L,I,SDV1,SDCL
36 K ^UTILITY($J)
37 D LO^DGUTL S SDLT1="",SDYES="",SDDT=DT,I=SDT,SDT=$P(I,".")
38 S SDMSG=" DOES NOT HAVE A NO-SHOW LETTER ASSIGNED TO IT!"
39 S SDV1=$O(^DG(40.8,0)) D DIV^SDUTL I $T S SDV1=$P($G(^SC(SC,0)),U,15)
40 D EN1^SDN,73^SDN,PAUSE^VALM1
41NSQ Q 'Y
42 ;
43CHK() ; -- check if status of appt permits no-show
44 N SDOK S SDOK=1
45 I '$D(^SD(409.63,"ANS",1,+SDSTB)) S SDOK=0,X="You cannot execute no-show processing for this appointment."
46 I SDOK,SDT>SDTIME S SDOK=1,X="It is too soon to no-show this appointment."
47 I 'SDOK W !!,*7,X K VALMY(SDI) D PAUSE^VALM1
48 Q SDOK
49 ;
50UPD(BEFORE,AFTER,SDAT,CNST) ; can just the 1 display line be changed w/o re-build
51 ; input: BEFORE := before status info in $$STATUS format
52 ; AFTER := after " " " " "
53 ; SDAT := selected VALMY entry's data
54 ; CNST := consult status (null, consult link ien)
55 N Y S Y=0
56 I +BEFORE=+AFTER S Y=1 G UPDQ
57 I $D(SDAMLIST(+AFTER)) S Y=1 I $D(SDAMLIST("SCR")) X SDAMLIST("SCR") S Y=$T
58 I 'Y,$P(SDAMLIST,U)="ALL" S Y=1
59 I Y D
60 . S ^TMP("SDAM",$J,+SDAT,0)=$$SETFLD^VALM1($P(AFTER,";",3),^TMP("SDAM",$J,+SDAT,0),"STAT")
61 . I '$G(CNST) S ^TMP("SDAM",$J,+SDAT,0)=$$SETFLD^VALM1(" ",^TMP("SDAM",$J,+SDAT,0),"CONSULT")
62UPDQ Q Y
Note: See TracBrowser for help on using the repository browser.