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

BHSDEN2.m

Go to the documentation of this file.
BHSDEN2 ;IHS/CIA/MGH - Health Summary for Dental ;17-Mar-2006 10:36;MGH
 ;;1.0;HEALTH SUMMARY COMPONENTS;;March 17, 2006
 ;===================================================================
 ;Taken from ADERVW2
 ; IHS/HQT/MJL  - DENTAL CHART REVW PART 4 ;  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;**12**;APRIL 1999
 ;Health summary for dental, followup and failed appointments
 ;====================================================================
DO ;  EP
 D CKP^GMTSUP Q:$D(GMTSQIT)
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=9999999 F  S ADER=$O(^ADEPAT(ADEPAT,"FA",ADER),-1) Q:'+ADER  D
 .S X=$P($G(^ADEPAT(ADEPAT,"FA",ADER,0)),U)
 .I +X D REGDT4^GMTSU S ADETXT=X_"  "_$S($P(^ADEPAT(ADEPAT,"FA",ADER,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 X=$P(^ADEFOL(ADEMDFN,0),U,3) D REGDT4^GMTSU S ADETXT=X_"  "_ADETXT_" "_ADETYPN
 S X=$P(^ADEFOL(ADEMDFN,0),U,4) D REGDT4^GMTSU S ADETXT=ADETXT_" Action: "_X S:$P(^ADEFOL(ADEMDFN,0),U,5)="u" ADETXT=ADETXT_" **URGENT**" X ADEPRT D:$P(^ADEFOL(ADEMDFN,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 X=$P(^ADEPAT(ADEPAT,"FOL",ADESUBD,0),U,2) D REGDT4^GMTSU S ADETXT=X
 S X=$P(^ADEPAT(ADEPAT,"FOL",ADESUBD,0),U,3) D REGDT4^GMTSU S ADETXT=ADETXT_"   "_X
 S ADENRQ="",ADEICL=20 X ADEPRT
 Q