source: WorldVistAEHR/trunk/r/VISTA_OFFICE_EHR-VEPE/VEPEREM3.m@ 1096

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

initial load of WorldVistAEHR

File size: 2.4 KB
Line 
1VEPEREM3 ;MRM/DAOU - Computed findings for DOQIT extracts. ; 6/30/05 8:03pm
2 ;;2.0;CLINICAL REMINDERS;;Feb 04, 2005
3 ;
4 ;==========================================================
5AGE ;
6 ; Convert age to months if under 2 years old.
7 N FIELDS,DOB,YR,MN,DAY,C,DYR,DMN,DDAY,DC
8 S FIELDS=".03",DATE=DT
9 D GETS^DIQ(2,DFN,FIELDS,"I","PAT","ERR")
10 S DOB=PAT(2,DFN_",",.03,"I")
11 Q:'+DOB
12 S MN=$E(DT,4,5),DAY=$E(DT,6,7),C=$E(DT,1)
13 S YR=1700+(C*100)+$E(DT,2,3)
14 S DMN=$E(DOB,4,5),DDAY=$E(DOB,6,7),DC=$E(DOB,1)
15 S DYR=1700+(DC*100)+$E(DOB,2,3)
16 I (DT-DOB)>20000 S CAGE=YR-DYR_"Y" S:(MN<DMN) CAGE=CAGE-1_"Y" Q
17 S MNOLD=(YR-DYR*12)+(12-DMN)-MN I DDAY>DAY S MNOLD=MNOLD-1
18 S CAGE=MNOLD_"M"
19 Q
20 ; The following tags are used for computed findings
21M1(DFN,TEST,DATE,VALUE,TEXT) ;One Month
22 N PAT,ERR,CAGE
23 D AGE
24 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
25 S VALUE=CAGE,TEXT="AGE"
26 I CAGE'["M" S TEST=1 Q
27 I +CAGE>0 S TEST=1 Q
28 S TEST=0,TEXT=""
29 Q
30M2(DFN,TEST,DATE,VALUE,TEXT) ;Two Months
31 N PAT,ERR,CAGE
32 D AGE
33 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
34 S VALUE=CAGE,TEXT="AGE"
35 I CAGE'["M" S TEST=1 Q
36 I +CAGE>1 S TEST=1 Q
37 S TEST=0,TEXT=""
38 Q
39M4(DFN,TEST,DATE,VALUE,TEXT) ;Four Months
40 N PAT,ERR,CAGE
41 D AGE
42 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
43 S VALUE=CAGE,TEXT="AGE"
44 I CAGE'["M" S TEST=1 Q
45 I +CAGE>3 S TEST=1 Q
46 S TEST=0,TEXT=""
47 Q
48M6(DFN,TEST,DATE,VALUE,TEXT) ;Six Months
49 N PAT,ERR,CAGE
50 D AGE
51 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
52 S VALUE=CAGE,TEXT="AGE"
53 I CAGE'["M" S TEST=1 Q
54 I +CAGE>5 S TEST=1 Q
55 S TEST=0,TEXT=""
56 Q
57M12(DFN,TEST,DATE,VALUE,TEXT) ;Twelve Months
58 N PAT,ERR,CAGE
59 D AGE
60 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
61 S VALUE=CAGE,TEXT="AGE"
62 I CAGE'["M" S TEST=1 Q
63 I +CAGE>11 S TEST=1 Q
64 S TEST=0,TEXT=""
65 Q
66M15(DFN,TEST,DATE,VALUE,TEXT) ;Fifteen Months
67 N PAT,ERR,CAGE
68 D AGE
69 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
70 S VALUE=CAGE,TEXT="AGE"
71 I CAGE'["M" S TEST=1 Q
72 I +CAGE>14 S TEST=1 Q
73 S TEST=0,TEXT=""
74 Q
75M18(DFN,TEST,DATE,VALUE,TEXT) ;Eighteen Months
76 N PAT,ERR,CAGE
77 D AGE
78 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
79 S VALUE=CAGE,TEXT="AGE"
80 I CAGE'["M" S TEST=1 Q
81 I +CAGE>17 S TEST=1 Q
82 S TEST=0,TEXT=""
83 Q
84M24(DFN,TEST,DATE,VALUE,TEXT) ;Twentyfour Months
85 N PAT,ERR,CAGE
86 D AGE
87 I $D(ERR) S TEST=0,TEXT=$G(ERR("DIERR",1,"TEXT",1)) Q
88 S VALUE=CAGE,TEXT="AGE"
89 I CAGE'["M" S TEST=1 Q
90 I CAGE>23 S TEST=1 Q
91 S TEST=0,TEXT=""
92 Q
Note: See TracBrowser for help on using the repository browser.