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

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

initial load of WorldVistAEHR

File size: 3.2 KB
RevLine 
[613]1DGNTUT ;ALB/RPM - Utility functions for N/T Radium Treatments ; 7/16/01 3:04pm
2 ;;5.3;Registration;**397**;Aug 13, 1993
3 Q
4 ;
5CHANGE(DGDFN,DGNTN,DGENR) ;Did the answers change?
6 ; Input
7 ; DGDFN - Patients DFN
8 ; DGNTN("HNC") - Head/Neck Cancer Diagnosis "Y,N"
9 ; DGNTN("NTR") - NTR Status code, "Y,N,U"
10 ; DGNTN("AVI") - Aviator code, "Y,N"
11 ; DGNTN("SUB") - Sub Training code, "Y,N"
12 ; DGNTN("VER") - Verification method, "S,M,N"
13 ; DGENR - Enrollment Z11 update [optional default=0]
14 ;
15 ; Output
16 ; Returns 0 if no status change
17 ; 1 if status changed
18 ;
19 N DGCHG ;change flag
20 N DGIEN ;IEN of existing NTR record
21 N DGNTO ;original values from $$GETCUR
22 N DGX ;generic index
23 ;
24 I +$G(DGDFN)'>0 Q 0
25 S DGNTN("HNC")=$G(DGNTN("HNC"))
26 S DGNTN("NTR")=$G(DGNTN("NTR"))
27 S DGNTN("AVI")=$G(DGNTN("AVI"))
28 S DGNTN("SUB")=$G(DGNTN("SUB"))
29 S DGNTN("VER")=$G(DGNTN("VER"))
30 S DGENR=+$G(DGENR)
31 S DGCHG=0
32 S DGIEN=+$$GETCUR^DGNTAPI(DGDFN,"DGNTO")
33 I DGIEN>0 D
34 . ;if this is an Enrollment update don't overlay a "M"ilitary Medical
35 . ;Record verified record with a "S"ervice Record verified record.
36 . I DGENR,$P($G(DGNTO("VER")),"^")="M",DGNTN("VER")="S" Q
37 . F DGX="HNC","NTR","AVI","SUB","VER" D Q:DGCHG
38 . . I $P($G(DGNTO(DGX)),"^")'=DGNTN(DGX) S DGCHG=1
39 I DGIEN=0 S DGCHG=1 ;new record
40CHNGQ Q DGCHG
41 ;
42SITE(DGSITE) ;Convert a station number into a pointer to the
43 ; INSTITUTION file (#4). If called with a null parameter then
44 ; the pointer to the INSTITUTION file (#4) of the primary site
45 ; will be returned.
46 ;
47 ; Input
48 ; DGSITE - Station number (optional)
49 ;
50 ; Output
51 ; Return Site IEN to INSTITUTION file (#4)
52 ;
53 S DGSITE=$G(DGSITE)
54 I DGSITE]"",$D(^DIC(4,"D",DGSITE)) D
55 . S DGSITE=$O(^DIC(4,"D",DGSITE,0))
56 E D
57 . S DGSITE=$P($$SITE^VASITE,U)
58 I +DGSITE'>0 S DGSITE=""
59 Q DGSITE
60 ;
61INTERP(DGINTR) ;Create external status interpretation
62 ;
63 ; Input
64 ; DGINTR - NTR record values array
65 ;
66 ; Output
67 ; DGINTRP - function return
68 ; NO
69 ; YES,PENDING BOTH DOCUMENTATION AND DIAGNOSIS
70 ; YES,PENDING DIAGNOSIS
71 ; YES,VERIFIED
72 ;
73 N DGINTRP ;interpretation
74 N DGX ;generic index
75 N DGINT ;temp array
76 F DGX="HNC","NTR","VER" S DGINT(DGX)=$P($G(@DGINTR@(DGX)),"^")
77 S DGINTRP="NO"
78 I DGINT("NTR")="Y"!(DGINT("NTR")="U") D
79 . I DGINT("VER")="" D
80 . . S DGINTRP="YES,PENDING BOTH DOCUMENTATION AND DIAGNOSIS"
81 . . I DGINT("HNC")="Y" D
82 . . . S DGINTRP="YES,PENDING DOCUMENTATION"
83 . I DGINT("VER")="M"!(DGINT("VER")="S") D
84 . . S DGINTRP="YES,PENDING DIAGNOSIS"
85 . . I DGINT("HNC")="Y" D
86 . . . S DGINTRP="YES,VERIFIED"
87 Q DGINTRP
88 ;
89STATUS(DGARR) ;Determine if screening status is complete
90 ; Input
91 ; DGARR - result array of $$GETCUR^DGNTAPI
92 ;
93 ; Output - function result
94 ; 0 - incomplete
95 ; 1 - complete
96 ;
97 N DGRSLT
98 N DGST ;temp array
99 S DGRSLT=0
100 S DGST("NTR")=$P($G(DGARR("NTR")),"^")
101 S DGST("HNC")=$P($G(DGARR("HNC")),"^")
102 S DGST("VER")=$P($G(DGARR("VER")),"^")
103 I DGST("NTR")="N" S DGRSLT=1
104 I DGST("NTR")="Y"!(DGST("NTR")="U") D
105 . S DGRSLT=2
106 . I ",S,M,"[(","_DGST("VER")_",") D
107 . . S DGRSLT=3
108 . . I DGST("HNC")="Y" D
109 . . . S DGRSLT=$S(DGST("VER")="M":4,1:5)
110 . I DGST("VER")="N" S DGRSLT=6
111 Q DGRSLT
Note: See TracBrowser for help on using the repository browser.