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

DGPT70DX.m

Go to the documentation of this file.
DGPT70DX ;ALB/MTC/ADL,HIOFO/FT -  DXLS Edit Checks for 701 ;3/3/15 12:46pm
 ;;5.3;Registration;**510,850,884**;Aug 13, 1993;Build 31
 ;;ADL;Update for CSV Project;;Mar 24, 2003
 ;
 ; ICDEX APIs - #5747
 ; ICDXCODE APIs - #5699
 ;
EN ;-- check dxls for entire stay
 S DGPTDDXE=$P(DGPTDDXE," ",1) ;DGPTDDXE = dxls for entire stay
 S DGPTERC=0
NOE ;quit if code starts with E
 ;E = Supplementary Classification of Factors Influencing Health Status
 ;    and Contact with Health Services.
 ;V = Supplementary Classification of External Causes of Inquiry and Poisoning
 N SYS,EFFDATE,IMPDATE,DGPTDAT
 D EFFDATE^DGPTIC10($G(PTF))
 S SYS=$$SYS^ICDEX("DIAG",EFFDATE)
 I SYS=1 I $E(DGPTDDXE,1)="E" S DGPTERC=750 Q
 I SYS=1 I $E(DGPTDDXE,1)="V" S DGPTERC=0 D DIAGV G:DGPTERC EXIT D SET G:DGPTERC EXIT G GENDR
 I SYS=1 Q:"VE"[$E(DGPTDDXE,1)
NUM ;
 S J1=$L(DGPTDDXE) F J=1:1:3 S DGPTDIA1=$E(DGPTDDXE,1,J)_"."_$E(DGPTDDXE,J+1,J1)_" " I +$$CODEN^ICDEX(DGPTDIA1,80)>0 D SET G:'DGPTERC GENDR
 S DGPTERC=715 G EXIT
SET ;
 N EFFDATE,IMPDATE,DGPTDAT
 D EFFDATE^DGPTIC10($G(PTF))
 S J=+$$CODEN^ICDEX(DGPTDIA1,80) I J<1 S DGPTERC=715 Q
 S DGPTTMP=$$ICDDATA^ICDXCODE("DIAG",J,EFFDATE)
 I DGPTTMP=-1!('$P(DGPTTMP,U,10)) S DGPTERC=715 Q
 I ($P(DGPTTMP,U,10)=0)&($E(DGPTDDS,1,7)>$P(DGPTTMP,U,12)) S DGPTERC=715 Q
 Q
GENDR ;patient's gender
 N EFFDATE,IMPDATE,DGPTDAT
 D EFFDATE^DGPTIC10($G(PTF))
 S DGPTTMP=$$ICDDATA^ICDXCODE("DIAG",J,EFFDATE)
 G:$P(DGPTTMP,U,11)']"" DDXE
 ;I $P(DGPTTMP,U,11)'=DGPTGEN S DGPTERC=751 G EXIT
DDXE ;
 S ICDDX(1)=J
 S DGPTDDXE=$P(DGPTDIA1," ",1)
EXIT ;
 K J,J1,DGPTDIA1
 Q
DIAGV ;Supplementary Classification of External Causes of Inquiry and Poisoning
 S DGPTDIA1=$E(DGPTDDXE,1,3)_"."_$E(DGPTDDXE,4,$L(DGPTDDXE))_" "
 I +$$CODEN^ICDEX(DGPTDIA1,80)<1 S DGPTERC=715
 Q