WVUTL4 ;HCIOFO/FT,JR IHS/ANMC/MWR - UTIL: DATE DEFAULTS, OTH VALUES; ;7/16/98 09:44 ;;1.0;WOMEN'S HEALTH;;Sep 30, 1998 ;;* MICHAEL REMILLARD, DDS * ALASKA NATIVE MEDICAL CENTER * ;; UTILITY: DEFAULT "COMPLETE BY" DATES FOR NOTIFS AND PROCEDURES, ;; STATUS TEXT, DIAG TEXT, NORMAL VALUE, COLP VALUE, MARGIN? VALUE. ; ; NDELQ() ;EP ;---> FOR NOTIFICATIONS: ;---> COMPUTE DEFAULT "COMPLETE BY (DATE)" - DATE AT WHICH A ;---> NOTIFICATION BECOMES DELINQUENT. CALLED BY WV NOTIF-EDITBLK-1. ;---> DEFAULT IS CREATED WHEN SCREEN IS FIRST LOADED. ;---> CODE HERE SETS X=EITHER 1: PRINT DATE (IF PRINTABLE), OR ;---> 2: DATE NOTIFICATION OPENED, OR ;---> 3: TODAY'S DATE ;---> THEN $$NDELQ1() IS CALLED TO ADD 30 DAYS UNTIL DELINQUENT. ;---> REQUIRED VARIABLE: DA (IEN OF NOTIFICATION). N X Q:'$D(DA) "" Q:'DA "" Q:'$D(^WV(790.4,DA,0)) "" S X=$P(^WV(790.4,DA,0),U,11) S:'X X=$P(^WV(790.4,DA,0),U,2) S:'X X=DT Q $$NDELQ1 ; NDELQ1() ;EP ;---> FOR NOTIFICATIONS: ;---> COMPUTE "COMPLETE BY (DATE)". CALLED BY UPDATE/EDIT OF ;---> "PRINT DATE:" IN WV NOTIF-EDITBLK-1. ;---> X1=EITHER NEW PRINT DATE, OR DATE NOTIF OPENED, OR TODAY. ;---> X2=30 DAYS ADDED TILL NOTIFICATION BECOMES DELINQUENT. ;---> REQUIRED VARIABLE: X=PRINT DATE, OR DATE OPENED, OR TODAY. N %H,X1,X2 Q:'$D(X) "" Q:'X "" S X1=X,X2=30 D C^%DTC Q X ; PDELQ(DA,DUZ2) ;EP ;---> FOR PROCEDURES: ;---> COMPUTE DEFAULT "COMPLETE BY (DATE)" - DATE AT WHICH A ;---> PROCEDURE BECOMES DELINQUENT. CALLED BY WV PROC-EDITBLK-1. ;---> DEFAULT IS CREATED WHEN SCREEN IS FIRST LOADED. ;---> CODE HERE FIRST RETRIEVES STORED DATE OF PROCEDURE, THEN CALLS ;---> $$DELQ1 TO COMPUTE "COMPLETE BY (DATE)". ;---> REQUIRED VARIABLE: DA (IEN OF PROCEDURE), DUZ2=DUZ(2). Q:'$G(DA)!('$G(DUZ2)) "" Q:'$D(^WV(790.1,DA,0)) "" Q:'$P(^WV(790.1,DA,0),U,12) "" Q $$PDELQ1(DA,$P(^WV(790.1,DA,0),U,12),DUZ2) ; PDELQ1(WVDA,WVDT,WVDUZ2) ;EP ;---> FOR PROCEDURES: ;---> COMPUTE "COMPLETE BY (WVDT)". CALLED BY UPWVDT/EDIT OF ;---> "WVDT OF PROCEDURE" IN WV PROC-EDITBLK-1. ;---> X1=WVDT OF PROCEDURE, X2=DEFAULT NUMBER OF WVDAYS THE ;---> PROCEDURE IS ALLOWED TO REMAIN OPEN BEFORE BECOMING DELINQUENT. ;---> REQUIRED VARIABLE: WVDA=IEN OF PROCEDURE, WVDT=DATE OF PROCEDURE, ;---> WVDUZ2=DUZ(2). N %H,X,X1,X2 Q:'$G(WVDA)!('$G(WVDT)) "" Q:'$D(^WV(790.1,WVDA,0)) "" S X2=$P(^WV(790.1,WVDA,0),U,4),X1=WVDT Q:'X2 "" Q:'$D(^WV(790.02,WVDUZ2,X2)) "" S X2=$P(^WV(790.02,WVDUZ2,X2),U,3) D C^%DTC Q X ; STATUS() ;EP ;---> PROVIDES STATUS (OPEN, DELINQUENT, OR CLOSED). ;---> Y MUST EQUAL ZERO NODE OF NOTIFICATION. ;---> REQUIRED VARIABLE: Y=ZERO NODE OF PROCEDURE, DT=FFDATE Q:'$D(Y) "UNKNOWN" Q:$P(Y,U,14)="c" "CLOSED" Q:$P(Y,U,13)]""&($P(Y,U,13)