Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: ADERVW2

ADERVW2.m

Go to the documentation of this file.
ADERVW2 ; IHS/HQT/MJL  - DENTAL CHART REVW PART 4 ;  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;**12**;APRIL 1999
 ;S DUZ=99 D ^XBKVAR D I2^ADERVW
 X ADECKP Q:$D(APCHSQIT)  X:'APCHSNPG ADEBRK
FAIL I '$D(^ADEPAT(ADEPAT,"FA")) S ADETXT="<No Failed Appointments>",ADENRQ="",ADEICL=0 W ! X ADEPRT G ACTIV
 S ADETXT="FAILED DENTAL APPOINTMENTS:",ADENRQ="",ADEICL=20 W ! X ADEPRT
 S:'$D(ADENDM) ADENDM=10 S ADENDMS=ADENDM
 ;IHS/ANMC/HMW 11-1-2002 **12** Replaced next line with one following to display
 ;failed appts in reverse chronological order
 ;S ADER=0 F ADEQ=0:0 S ADER=$O(^ADEPAT(ADEPAT,"FA",ADER)) Q:'+ADER  S Y=$P(^ADEPAT(ADEPAT,"FA",ADER,0),U) X ADECVD S ADETXT=Y_"  "_$S($P(^(0),U,2)="b":"BROKEN",1:"CANCELLED") S ADEICL=0,ADENRQ="" X ADEPRT S ADENDMS=ADENDMS-1 Q:'ADENDMS
 S ADER=9999999 F  S ADER=$O(^ADEPAT(ADEPAT,"FA",ADER),-1) Q:'+ADER  S Y=$P($G(^ADEPAT(ADEPAT,"FA",ADER,0)),U) I +Y X ADECVD S ADETXT=Y_"  "_$S($P(^(0),U,2)="b":"BROKEN",1:"CANCELLED") S ADEICL=0,ADENRQ="" X ADEPRT S ADENDMS=ADENDMS-1 Q:'ADENDMS
ACTIV I '$D(^ADEFOL("TYPE",ADEPAT)) S ADETXT="<Not on Active Dental Followup>",ADENRQ="",ADEICL=0 W ! X ADEPRT G PREV
 S ADETXT="ACTIVE DENTAL FOLLOWUP SUMMARY:",ADENRQ="",ADEICL=20 W ! X ADEPRT
 S ADETYP=0 F ADEQ=0:0 S ADETYP=$O(^ADEFOL("TYPE",ADEPAT,ADETYP)) Q:ADETYP=""  S ADENRQ="",ADETYPN=$S(ADETYP="w":"WAITING",ADETYP="rf":"REFERRAL",ADETYP="rc":"RECALL")_" LIST" D R2
 ;------->PREVIOUS FOLLOWUP
PREV I '$D(^ADEPAT(ADEPAT,"FOL")) S ADETXT="<No Previous Followup>",ADENRQ="",ADEICL=0 W ! X ADEPRT G END
 S ADETXT="PREVIOUS DENTAL FOLLOWUP:",ADENRQ="",ADEICL=20 W ! X ADEPRT
 S ADETXT="TYPE:               ADDED:     REMOVED:",ADENRQ="",ADEICL=0 X ADEPRT
 S:'$D(ADENDM) ADENDM=10 S ADENDMS=ADENDM
 S ADESUB=0 F ADEQ=0:0 S ADESUB=$O(^ADEPAT(ADEPAT,"FOL","B",ADESUB)) Q:'+ADESUB  D P1 S ADESUBD=0 F ADEQ=0:0 S ADESUBD=$O(^ADEPAT(ADEPAT,"FOL","B",ADESUB,ADESUBD)) Q:'+ADESUBD  D P2 S ADENDMS=ADENDMS-1 Q:ADENDMS=0
 ;
END Q
R2 S ADECAT=0 F ADEQ=0:0 S ADECAT=$O(^ADEFOL("TYPE",ADEPAT,ADETYP,ADECAT)) Q:'+ADECAT  S ADETXT=$P(^ADETYP(ADECAT,0),U),ADENRQ="",ADEICL=0 D R3
 Q
R3 S ADEMDFN=0 F ADEQ=0:0 S ADEMDFN=$O(^ADEFOL("TYPE",ADEPAT,ADETYP,ADECAT,ADEMDFN)) Q:'+ADEMDFN  D R4
 Q
R4 ;S Y=$P(^ADEFOL(ADEMDFN,0),U,3) X ADECVD S ADETXT=Y_"  "_ADETXT_" "_ADETYPN S:$P(^(0),U,5)="u" ADETXT=ADETXT_" **URGENT**" X ADEPRT D:$P(^(0),U,6)]"" R5 Q  ;ADETXT=ADETXT_" ACTION TAKEN: "_$P(^(0),U,6) X ADEPRT Q
 S Y=$P(^ADEFOL(ADEMDFN,0),U,3) X ADECVD S ADETXT=Y_"  "_ADETXT_" "_ADETYPN S Y=$P(^ADEFOL(ADEMDFN,0),U,4) X ADECVD S ADETXT=ADETXT_" Action: "_Y S:$P(^(0),U,5)="u" ADETXT=ADETXT_" **URGENT**" X ADEPRT D:$P(^(0),U,6)]"" R5 Q
R5 S ADETXT="ACTION TAKEN: "_$P(^ADEFOL(ADEMDFN,0),U,6),ADEICL=15 X ADEPRT S ADEICL=0 Q
P1 S ADETXT=$P(^ADETYP(ADESUB,0),U) ;
 S ADETXT=ADETXT_" "_$S($P(^ADETYP(ADESUB,0),U,4)="w":"WAITING",$P(^(0),U,4)="rc":"RECALL",$P(^(0),U,4)="rf":"REFERRAL",1:"OTHER")_" LIST"
 S ADENRQ="",ADEICL=0 X ADEPRT
 Q
P2 S Y=$P(^ADEPAT(ADEPAT,"FOL",ADESUBD,0),U,2) X ADECVD S ADETXT=Y
 S Y=$P(^ADEPAT(ADEPAT,"FOL",ADESUBD,0),U,3) X ADECVD S ADETXT=ADETXT_"   "_Y
 S ADENRQ="",ADEICL=20 X ADEPRT
 Q
EN ;EP ------->ENTRY POINT FOR FOLLOWUP REVIEW OPTION
 ;S ADEPCC=0 D PATLK^ADERVW G:Y<1 END
 N ADEPCC,ADEPAT
 S ADEPCC=0
 S ADEPAT=1
 K DIC S DIC="^AUPNPAT(",DIC(0)="AEQMZ" D ^DIC
 I Y<1 G ENEND
 S ADEPAT=+Y
ASKDEV ;FHL 9/9/98 S %ZIS="Q" D ^%ZIS G:POP ENEND I $D(IO("Q")) K IO("Q") D QUE W:$D(ZTSK) !,"REQUEST QUEUED!" G ENEND
 S %ZIS="Q" D ^%ZIS G:POP ENEND I $D(IO("Q")) K IO("Q") D QUE W:$D(ZTQUEUED) !,"REQUEST QUEUED!" G ENEND
ZTM D I2^ADERVW D FAIL D END^ADERVW
ENEND Q
QUE S ZTRTN="ZTM^ADERVW2",ZTDESC="DENTAL FOLLOWUP INQUIRY",ZTSAVE("ADEPAT")="",ZTSAVE("ADEPCC")="" D ^%ZTLOAD Q