DGPTAE03 ;ALB/MTC - 501 Edit Checks Cont ; 13 NOV 92
;;5.3;Registration;**8,52,164,1015**;Aug 13, 1993;Build 21
;
501 ;--Check elapsed days between movements vs leave and pass days
;
S (X2,X3,DGPTL3)=0 F DGPTL4=0:0 S DGPTL3=$O(^TMP("AEDIT",$J,"N501",DGPTL3)) Q:DGPTL3="" D
. S X3=$$FMDT^DGPT101($E(^TMP("AEDIT",$J,"N501",DGPTL3),31,36))_"."_$E(^TMP("AEDIT",$J,"N501",DGPTL3),37,40) I (X3<DGPTMDTS)&(X3>X2) S X2=X3
I X2=0 S X2=DGPTDTS
D ^%DTC I X>0,(X-DGPTMLD-DGPTMPD<0) S DGPTERC=543
K X,X1,X2,X3,DGPTL3,DGPTL4
Q
;
535 ;--Check elapsed days between movements vs leave and pass days
;
S (X2,X3,DGPTL3)=0 F DGPTL4=0:0 S DGPTL3=$O(^TMP("AEDIT",$J,"N535",DGPTL3)) Q:DGPTL3="" D
. S X3=$$FMDT^DGPT101($E(^TMP("AEDIT",$J,"N535",DGPTL3),31,36))_"."_$E(^TMP("AEDIT",$J,"N535",DGPTL3),37,40) I (X3<DGPTTDTS)&(X3>X2) S X2=X3
I X2=0 S X2=DGPTDTS
D ^%DTC I X>0,(X-DGPTTLD-DGPTTPD<0) S DGPTERC=543
K X,X1,X2,X3,DGPTL3,DGPTL4
Q
;
SP ; Spinal injury and related diagnosis edits
D EDIT I DGPTERC Q
D DIA
Q
EDIT ;
N FLAG,I
I "1234X "'[DGPTMSI S DGPTERC=509 Q
I DGPTSTTY="^"!(DGPTSTTY="") Q
I "1234X"[DGPTMSI S DGPTERC=509,FLAG=1 F I=10,11,30,40,42 S I=U_I_U I DGPTSTTY[I S DGPTERC=0,FLAG=0 Q
Q
DIA ;
Q:(DGPTSTTY'["^10^")!(DGPTSTTY'["^11^")
I DGPTMSI="X"&((DGPTMD1?1"3440"1N)!(DGPTMD1=3441)!(DGPTMD2?1"3440"1N)!(DGPTMD2=3441)!(DGPTMD3?1"3440"1N)!(DGPTMD3=3441)!(DGPTMD4?1"3440"1N)!(DGPTMD4=3441)!(DGPTMD5?1"3440"1N)!(DGPTMD5=3441)) S DGPTERC=554 Q
I "13"[DGPTMSI&((DGPTMD1'=3441)&(DGPTMD2'=3441)&(DGPTMD3'=3441)&(DGPTMD4'=3441)&(DGPTMD5'=3441)) S DGPTERC=554 Q
I "24"[DGPTMSI&((DGPTMD1'?1"3440"1N)&(DGPTMD2'?1"3440"1N)&(DGPTMD3'?1"3440"1N)&(DGPTMD4'?1"3440"1N)&(DGPTMD5'?1"3440"1N)) S DGPTERC=554 Q
Q
;
DGPTAE03 ;ALB/MTC - 501 Edit Checks Cont ; 13 NOV 92
+1 ;;5.3;Registration;**8,52,164,1015**;Aug 13, 1993;Build 21
+2 ;
501 ;--Check elapsed days between movements vs leave and pass days
+1 ;
+2 SET (X2,X3,DGPTL3)=0
FOR DGPTL4=0:0
SET DGPTL3=$ORDER(^TMP("AEDIT",$JOB,"N501",DGPTL3))
IF DGPTL3=""
QUIT
Begin DoDot:1
+3 SET X3=$$FMDT^DGPT101($EXTRACT(^TMP("AEDIT",$JOB,"N501",DGPTL3),31,36))_"."_$EXTRACT(^TMP("AEDIT",$JOB,"N501",DGPTL3),37,40)
IF (X3<DGPTMDTS)&(X3>X2)
SET X2=X3
End DoDot:1
+4 IF X2=0
SET X2=DGPTDTS
+5 DO ^%DTC
IF X>0
IF (X-DGPTMLD-DGPTMPD<0)
SET DGPTERC=543
+6 KILL X,X1,X2,X3,DGPTL3,DGPTL4
+7 QUIT
+8 ;
535 ;--Check elapsed days between movements vs leave and pass days
+1 ;
+2 SET (X2,X3,DGPTL3)=0
FOR DGPTL4=0:0
SET DGPTL3=$ORDER(^TMP("AEDIT",$JOB,"N535",DGPTL3))
IF DGPTL3=""
QUIT
Begin DoDot:1
+3 SET X3=$$FMDT^DGPT101($EXTRACT(^TMP("AEDIT",$JOB,"N535",DGPTL3),31,36))_"."_$EXTRACT(^TMP("AEDIT",$JOB,"N535",DGPTL3),37,40)
IF (X3<DGPTTDTS)&(X3>X2)
SET X2=X3
End DoDot:1
+4 IF X2=0
SET X2=DGPTDTS
+5 DO ^%DTC
IF X>0
IF (X-DGPTTLD-DGPTTPD<0)
SET DGPTERC=543
+6 KILL X,X1,X2,X3,DGPTL3,DGPTL4
+7 QUIT
+8 ;
SP ; Spinal injury and related diagnosis edits
+1 DO EDIT
IF DGPTERC
QUIT
+2 DO DIA
+3 QUIT
EDIT ;
+1 NEW FLAG,I
+2 IF "1234X "'[DGPTMSI
SET DGPTERC=509
QUIT
+3 IF DGPTSTTY="^"!(DGPTSTTY="")
QUIT
+4 IF "1234X"[DGPTMSI
SET DGPTERC=509
SET FLAG=1
FOR I=10,11,30,40,42
SET I=U_I_U
IF DGPTSTTY[I
SET DGPTERC=0
SET FLAG=0
QUIT
+5 QUIT
DIA ;
+1 IF (DGPTSTTY'["^10^")!(DGPTSTTY'["^11^")
QUIT
+2 IF DGPTMSI="X"&((DGPTMD1?1"3440"1N)!(DGPTMD1=3441)!(DGPTMD2?1"3440"1N)!(DGPTMD2=3441)!(DGPTMD3?1"3440"1N)!(DGPTMD3=3441)!(DGPTMD4?1"3440"1N)!(DGPTMD4=3441)!(DGPTMD5?1"3440"1N)!(DGPTMD5=3441))
SET DGPTERC=554
QUIT
+3 IF "13"[DGPTMSI&((DGPTMD1'=3441)&(DGPTMD2'=3441)&(DGPTMD3'=3441)&(DGPTMD4'=3441)&(DGPTMD5'=3441))
SET DGPTERC=554
QUIT
+4 IF "24"[DGPTMSI&((DGPTMD1'?1"3440"1N)&(DGPTMD2'?1"3440"1N)&(DGPTMD3'?1"3440"1N)&(DGPTMD4'?1"3440"1N)&(DGPTMD5'?1"3440"1N))
SET DGPTERC=554
QUIT
+5 QUIT
+6 ;