source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPT70DI.m@ 1046

Last change on this file since 1046 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1DGPT70DI ;ALB/MTC/ADL - Diagnosis edits for 700's - E codes, V codes, gender and ICD9 Diag. ; 16 NOV 92
2 ;;5.3;Registration;**510**;Aug 13, 1993
3 ;;ADL;Update for CSV Project;;Mar. 24, 2003
4 ;
5EN ;
6 F DGPTL3=1:1:9 S DGPTDIA=$P((@("DGPTGD"_DGPTL3))," ",1) S DGPTERC=0 D DIAG I DGPTERC D ERR G:DGPTEDFL EXIT
7 Q
8 ;
9DIAG ;
10 Q:DGPTDIA=""
11 I $E(DGPTDIA,1)="E" S DGPTERC=0 D DIAGE Q
12 I $E(DGPTDIA,1)="V" S DGPTERC=0 D DIAGV Q
13 S DGPTERC=719+DGPTL3
14 F DGPTL4=1:1:$L(DGPTDIA) S DGPTDIA1=$E(DGPTDIA,1,DGPTL4)_"."_$E(DGPTDIA,DGPTL4+1,$L(DGPTDIA))_" " I $D(^ICD9("AB",DGPTDIA1)) S DGPTERC=0 D GEN Q
15 Q
16ERR ;
17 D WRTERR^DGPTAE(DGPTERC,NODE,SEQ)
18 Q
19EXIT ;
20 K DGPTDIA,DGPTDIA1,DGPTDIA2,DGPTL3,DGPTL4
21 Q
22DIAGE ;
23 Q:$E(DGPTDIA)'="E"
24 S DGPTDIA1=$E(DGPTDIA,1,4)_"."_$E(DGPTDIA,5,$L(DGPTDIA))_" "
25 I '$D(^ICD9("AB",DGPTDIA1)) S DGPTERC=719+DGPTL3 Q
26 S DGPTDIA2=$O(^ICD9("AB",DGPTDIA1,0)) I DGPTDIA2="" S DGPTERC=719+DGPTL3 Q
27 S DGPTTMP=$$ICDDX^ICDCODE(DGPTDIA2,$S($G(DGPTDDS)'="":DGPTDDS,1:DT)) ;use date of disp. if defined, else today
28 I DGPTTMP=-1!('$P(DGPTTMP,U,10)) S DGPTERC=719+DGPTL3 Q
29 I ($P(DGPTTMP,U,10)=0)&($E(DGPTDDS,1,7)>$P(DGPTTMP,U,12)) S DGPTERC=719+DGPTL3 Q
30 I ($P(DGPTTMP,U,11)]"")&(DGPTGEN'=$P(DGPTTMP,U,11)) S DGPTERC=719+DGPTL3 Q
31 S @("DGPTGD"_DGPTL3)=$P(DGPTDIA1," ",1)
32 S DGPTDIAR(DGPTDDS)=$S($D(DGPTDIAR(DGPTDDS)):DGPTDIAR(DGPTDDS)_U_DGPTDIA2,1:DGPTDIA2)
33 Q
34DIAGV ;
35 Q:$E(DGPTDIA)'="V"
36 S DGPTDIA1=$E(DGPTDIA,1,3)_"."_$E(DGPTDIA,4,$L(DGPTDIA))_" "
37 I '$D(^ICD9("AB",DGPTDIA1)) S DGPTERC=719+DGPTL3 Q
38 S DGPTDIA2=$O(^ICD9("AB",DGPTDIA1,0)) I DGPTDIA2="" S DGPTERC=719+DGPTL3 Q
39 S DGPTTMP=$$ICDDX^ICDCODE(DGPTDIA2,$S($G(DGPTDDS)'="":DGPTDDS,1:DT)) ;use date of disp. if defined, else today
40 I DGPTTMP=-1!('$P(DGPTTMP,U,10)) S DGPTERC=719+DGPTL3 Q
41 I ($P(DGPTTMP,U,10)=0)&($E(DGPTDDS,1,7)>$P(DGPTTMP,U,12)) S DGPTERC=719+DGPTL3 Q
42 I ($P(DGPTTMP,U,11)]"")&(DGPTGEN'=$P(DGPTTMP,U,11)) S DGPTERC=719+DGPTL3 Q
43 S @("DGPTGD"_DGPTL3)=$P(DGPTDIA1," ",1)
44 S DGPTDIAR(DGPTDDS)=$S($D(DGPTDIAR(DGPTDDS)):DGPTDIAR(DGPTDDS)_U_DGPTDIA2,1:DGPTDIA2)
45 Q
46GEN ;
47 S DGPTDIA2=$O(^ICD9("AB",DGPTDIA1,0)) I DGPTDIA2="" S DGPTERC=719+DGPTL3 Q
48 S DGPTTMP=$$ICDDX^ICDCODE(DGPTDIA2,$S($G(DGPTDDS)'="":DGPTDDS,1:DT)) ;use date of disp. if defined, else today
49 I DGPTTMP=-1!('$P(DGPTTMP,U,10)) S DGPTERC=719+DGPTL3 Q
50 I $P(DGPTTMP,U,11)]""&(DGPTGEN'=$P(DGPTTMP,U,11)) S DGPTERC=751 Q
51 S @("DGPTGD"_DGPTL3)=$P(DGPTDIA1," ",1)
52ARRAY ;
53 S DGPTDIAR(DGPTDDS)=$S($D(DGPTDIAR(DGPTDDS)):DGPTDIAR(DGPTDDS)_U_DGPTDIA2,1:DGPTDIA2)
54 Q
Note: See TracBrowser for help on using the repository browser.