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

ADEMNG.m

Go to the documentation of this file.
ADEMNG ; IHS/HQT/MJL - DENTAL FOLLOWUP MGMT ;  [ 03/24/1999   9:04 AM ]
 ;;6.0;ADE;;APRIL 1999
 ;S ADEREF=0,ADEREC=1,ADEWAI=0 ;SET IN CALLING OPTION
 ;------->INITIALIZE
 Q:'$D(ADEREF)!'$D(ADEREC)!'$D(ADEWAI)  S ADEINT=0,$P(ADELIN,"*",79)=""
 S ADETYP=$S(ADEREF:"rf",ADEREC:"rc",ADEWAI:"w")
 D ^XBKVAR I '$D(DUZ(2)) W !,"DIVISION NOT SET IN USER FILE -- CONTACT SITE MANAGER OR ISC" Q
 I DUZ(2)=0 W !,"DIVISION SET TO ZERO (UNIVERSAL). DIVISION MUST BE SET TO ONE OF THE ",!,"SITES IN THE DENTAL SITE PARAMETER FILE. -- CONTACT SITE MANAGER" Q
ONE ;------->RESET CONSTANT FOLLOWUP SUBTYPE
 ;        RETURN ADESUB=DFN IN ^ADETYP(
 D RESET^ADEMNG1 G:Y<1 END
TWO ;------->LOOK UP A PATIENT
 ;        RETURN ADENEWM=1 IF NEW =0 IF EDIT
 D PTLOOK^ADEMNG1 G:Y<1 ONE
FOUR ;------->CHECK IF ALREADY ON LIST ;***ASK IF SHOULD BE REMOVED
 I $D(^ADEFOL("TYPE",ADEPAT,ADETYP,ADESUB)) D MOD
ADDR ;------->EDIT ADDRESS
 D P2^ADEMNG1
 I $D(Y) W !,"***FOLLOWUP DATA ENTRY ABORTED***" H 2 G:ADEINT END1 K ^ADEUTL("ADELOCK",ADEPAT) G TWO
FIVE ;------->COLLECT FOLLOWUP INFO
 D ^ADEMNG3
SIX ;------->WRITE DATA TO DISK, QUIT IF CALLED INTERNALLY
 D:Y ^ADEMNG6 G:ADEINT END1
SEVEN ;------->GET ANOTHER PATIENT
 K ^ADEUTL("ADELOCK",ADEPAT)
 K ADENEWM,ADEPAT,ADEPRI,ADEMPRO,ADEMPROD,ADEMDAT,ADEMACT,ADEMDFN,ADENOD
 G TWO
END D ^ADECLS K ADELIN
END1 K ADEDICS,ADEFUNC,ADEINT,ADEMDAT,ADEMDFN,ADEMDUZ,ADEMPRO,ADEMPROD,ADENEWM,ADEPRI,ADEREC,ADEREF,ADESUB,ADESUBN,ADETITL,ADETYP,ADEWAI
 Q
MOD ;------->LOAD LOCALS WITH EDIT DATA
 W !?5,*7,$P(^DPT(ADEPAT,0),U)," IS ALREADY ON THE ",$P(^ADETYP(ADESUB,0),U)," ",$S(ADEWAI:"WAITING",ADEREC:"RECALL",1:"REFERRAL")," LIST!"
 S ADENOD=^ADEFOL(ADEMDFN,0),ADEPRI=$P(ADENOD,U,5),ADEMDAT=$P(ADENOD,U,3),ADEMPROD=$P(ADENOD,U,7),ADEMACT=$P(ADENOD,U,4)
 F J="ADEMDAT","ADEMACT" S Y=@J X ^DD("DD") S @J=Y
 I ADEMPROD'="",$D(^DIC(16,ADEMPROD,0)) S ADEMPRO=$P(^DIC(16,ADEMPROD,0),U) ;IHS/HMW ADDED CONDITIONAL SET 6-20-90
Z S ADEPRI=$S(ADEPRI="u":"URGENT",ADEPRI="r":"ROUTINE",1:"HIGH")
 Q
EN ;EP
 ;------->GET A FOLLOWUP SUBTYPE IF CALLED INTERNALLY --ENDO,PROS
 ;        THIS IS INTERNAL ENTRY POINT -- TYPE SET BY CALLING ROUTINE
 ;        RETURN ADENEWM=1 IF NEW, 0 IF EDIT
 S ADEINT=1 D R2^ADEMNG1 G:Y<1 END1
 S ADENEWM=1
 I $D(^ADEFOL("TYPE",ADEPAT,ADETYP,ADESUB)) S ADEMDFN=$O(^ADEFOL("TYPE",ADEPAT,ADETYP,ADESUB,0)),ADENEWM=0 D MOD
 G ADDR