source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SDCO22.m@ 1005

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

initial load of WorldVistAEHR

File size: 3.5 KB
RevLine 
[613]1SDCO22 ;ALB/RMO/MRY - Classification Cont. - Screen - Check Out;21 JUL 2000 11:15 PM ; 8/30/01 11:19am [6/28/05 2:02pm]
2 ;;5.3;Scheduling;**150,222,244,325,394**;Aug 13, 1993
3 ;
4AO(DFN,SDOE) ;Ask Agent Orange Exposure Classification
5 ; Input -- DFN Patient file IEN
6 ; SDOE Outpatient Encounter file IEN [Optional]
7 ; Output -- 1=Yes and 0=No
8 N SDELG0,Y
9 I $P($G(^DPT(DFN,.321)),"^",2)'="Y" G AOQ
10 S SDELG0=$$EL(DFN,$G(SDOE))
11 I $P(SDELG0,"^",5)="Y","^1^2^3^4^5^"[("^"_$P(SDELG0,"^",4)_"^") S Y=1
12 I $G(Y),$G(SDOE) D
13 .I '$$AP(SDOE,1) S Y=0 Q
14 .I $P(SDELG0,"^",4)=3!($P(SDELG0,"^",4)=1),$P($G(^SDD(409.42,+$O(^SDD(409.42,"AO",+SDOE,3,0)),0)),"^",3) S Y=0
15AOQ Q +$G(Y)
16 ;
17IR(DFN,SDOE) ;Ask Ionizing Radiation Exposure Classification
18 ; Input -- DFN Patient file IEN
19 ; SDOE Outpatient Encounter file IEN [Optional]
20 ; Output -- 1=Yes and 0=No
21 N SDELG0,Y
22 I $P($G(^DPT(DFN,.321)),"^",3)'="Y" G IRQ
23 S SDELG0=$$EL(DFN,$G(SDOE))
24 I $P(SDELG0,"^",5)="Y","^1^2^3^4^5^"[("^"_$P(SDELG0,"^",4)_"^") S Y=1
25 I $G(Y),$G(SDOE) D
26 .I '$$AP(SDOE,2) S Y=0 Q
27 .I $P(SDELG0,"^",4)=3!($P(SDELG0,"^",4)=1),$P($G(^SDD(409.42,+$O(^SDD(409.42,"AO",+SDOE,3,0)),0)),"^",3) S Y=0
28IRQ Q +$G(Y)
29 ;
30SC(DFN,SDOE) ;Ask Service Connected Condition Classification
31 ; Input -- DFN Patient file IEN
32 ; SDOE Outpatient Encounter file IEN [Optional]
33 ; Output -- 1=Yes and 0=No
34 N SDELG0,Y
35 S SDELG0=$$EL(DFN,$G(SDOE))
36 I $P(SDELG0,"^",5)="Y","^1^3^"[("^"_$P(SDELG0,"^",4)_"^") S Y=1
37 I $G(Y),$G(SDOE) D
38 .I '$$AP(SDOE,3) S Y=0 Q
39SCQ Q +$G(Y)
40 ;
41EC(DFN,SDOE) ;Ask Environmental Contaminant Exposure Classification
42 ; Input -- DFN Patient file IEN
43 ; SDOE Outpatient Encounter file IEN [Optional]
44 ; Output -- 1=Yes and 0=No
45 N SDELG0,Y
46 S SDELG0=$$EL(DFN,$G(SDOE))
47 I $P($G(^DPT(DFN,.322)),"^",13)'="Y" D G ECQ
48 .I $P(SDELG0,"^",5)="N","^4^"[("^"_$P(SDELG0,"^",4)_"^"),"^A^B^C^D^6^"[("^"_($P($G(^DIC(21,+$P($G(^DPT(DFN,.32)),"^",3),0)),"^",3))_"^") S Y=1
49 I $P(SDELG0,"^",5)="Y","^1^2^3^4^5^"[("^"_$P(SDELG0,"^",4)_"^") S Y=1
50 I $G(Y),$G(SDOE) D
51 .I '$$AP(SDOE,4) S Y=0 Q
52 .I $P(SDELG0,"^",4)=3!($P(SDELG0,"^",4)=1),$P($G(^SDD(409.42,+$O(^SDD(409.42,"AO",+SDOE,3,0)),0)),"^",3) S Y=0
53ECQ Q +$G(Y)
54 ;
55EL(DFN,SDOE) ;Eligibility
56 Q $G(^DIC(8.1,+$P($G(^DIC(8,+$S($P($G(^SCE(+$G(SDOE),0)),"^",13):+$P(^(0),"^",13),1:+$G(^DPT(DFN,.36))),0)),"^",9),0))
57 ;
58AP(SDOE,SDCTI) ;Classification Appointment Type Screen
59 N SDAPTY,Y
60 S SDAPTY=+$P($G(^SCE(+SDOE,0)),"^",10)
61 I SDAPTY=9 S Y=1
62 I SDAPTY=11 S Y=1
63 I SDAPTY=2,SDCTI=3 S Y=1
64APQ Q +$G(Y)
65 ;
66MST(DFN,SDOE) ;Ask Military Sexual Trauma Classification
67 ;Input - DFN Patient file IEN
68 ; SDOE Outpatient Encounter file IEN
69 ;Output - 1=Yes, 0=No
70 N DGMST
71 S DGMST=$$GETSTAT^DGMSTAPI(DFN)
72 Q +($P(DGMST,U,2)="Y")
73 ;
74HNC(DFN,SDOE) ;Ask Head & Neck Classification
75 ;Input - DFN Patient file IEN
76 ; SDOE Outpatient Encounter file IEN
77 ;Output - 1=Yes, 0=No
78 N DGARR,SDELG0,Y
79 S SDELG0=$$GETCUR^DGNTAPI(DFN,"DGARR")
80 S SDELG0=+$G(DGARR("STAT"))
81 ;Only a status of 3, 4 or 5 is accepted for the question to be asked
82 S Y=$S((".3.4.5."[("."_SDELG0_".")):1,1:0)
83HNCQ Q +$G(Y)
84 ;
85CV(DFN,SDOE,SDDT) ;Ask Combat Veteran Classification
86 ;Input : DFN - Pointer to PATIENT file (#2)
87 ; SDOE - Pointer to OUTPATIENT ENCOUNTER file (#409.68)
88 ; SDDT - Date (FileMan format) (optional - SDOE overrides)
89 ;Output: 1 = Yes / 0 = No
90 N SDCV
91 S SDDT=$G(SDDT)
92 S:$G(SDOE) SDDT=+$G(^SCE(+$G(SDOE),0))
93 S:'SDDT SDDT=$$DT^XLFDT()
94 S SDCV=$$CVEDT^DGCV(DFN,SDDT)
95 Q $P(SDCV,"^",3)
Note: See TracBrowser for help on using the repository browser.