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,HIOFO/FT - 501 Edit Checks Cont ;10/29/2014 3:42pm
 ;;5.3;Registration;**8,52,164,850,884**;Aug 13, 1993;Build 31
 ;
 ; ICDEX APIs - #5747
 ;
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 ; - Diagnosis check for Spinal Cord Injury
 Q:(DGPTSTTY'["^10^")!(DGPTSTTY'["^11^")
 N SYS,EFFDATE,IMPDATE,DGPTDAT
 D EFFDATE^DGPTIC10($G(PTF))
 S SYS=$$SYS^ICDEX("DIAG",EFFDATE)
 I SYS=1 D
 . 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
 I SYS=30 D  ;icd10
 . N DGLOOP,DGPTDXCODE,DGPTFLAG
 . S DGPTFLAG=0
 . F DGLOOP=1:1:25 S DGPTDXCODE=@("DGPTMD"_DGLOOP) D  Q:DGPTFLAG
 .. I (DGPTDXCODE?1"G822"1N)!(DGPTDXCODE?1"G825"1N) S DGPTFLAG=1
 . I DGPTMSI="X"&(DGPTFLAG=1) S DGPTERC=554 Q
 . I "13"[DGPTMSI&(DGPTFLAG=1) S DGPTERC=554 Q
 . I "24"[DGPTMSI&(DGPTFLAG=1) S DGPTERC=554 Q
 . Q
 Q