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

DGPTAE03.m

Go to the documentation of this file.
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
 ;