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

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

initial load of WorldVistAEHR

File size: 5.6 KB
Line 
1DGNTAPI1 ;ALB/RPM - API's for N/T Radium Treatment(part 2); 7/16/01 3:04pm
2 ;;5.3;Registration;**397,423**;Aug 13, 1993
3 Q
4 ;
5ENRUPD(DGDFN,DGHEC) ;
6 ;This function is the entry point for HEC/Enrollment data updates
7 ;via the Enrollment HL7 message upload.
8 ;
9 ; Input:
10 ; DGDFN - PATIENT file (#2) IEN
11 ; DGHEC - update values array passed by reference
12 ; DGHEC("NTR") - Nose/Throat Radium
13 ; DGHEC("AVI") - Aviator?
14 ; DGHEC("SUB") - Submariner
15 ; DGHEC("VER") - Verification method
16 ; DGHEC("VDT") - Verification completion date/time
17 ; DGHEC("VSIT") - Verification site
18 ; DGHEC("HNC") - Head/Neck CA DX
19 ; DGHEC("HDT") - Head/Neck CA date/time
20 ; DGHEC("HSIT") - Site determining CA DX
21 ;
22 ; Output:
23 ; function result 1-success, 0-failure
24 ;
25 N DGRSLT
26 N DGX ;generic index
27 S DGRSLT=0
28 S DGDFN=+$G(DGDFN)
29 F DGX="NTR","AVI","SUB","VER","VDT","VSIT","HNC","HDT","HSIT" D
30 . S DGHEC(DGX)=$G(DGHEC(DGX))
31 I DGDFN>0,$D(^DPT(DGDFN)),DGHEC("NTR")]"",DGHEC("VDT")]"",$$CHANGE^DGNTUT(DGDFN,.DGHEC,1) D
32 . S DGHEC("EUSR")=DUZ
33 . S DGHEC("EDT")=$$NOW^XLFDT
34 . S DGRSLT=$$FILENTR^DGNTAPI(DGDFN,.DGHEC,0)
35 Q DGRSLT
36 ;
37ENRGET(DGDFN,DGENR) ;Entry point for Enrollment data retrieval from
38 ;NOSE AND THROAT RADIUM HISTORY file (#28.11).
39 ;
40 ; Input:
41 ; DGDFN - IEN of patient in the PATIENT (#2) file
42 ; DGENR - Array name of return values [Optional - Default DGNTARR]
43 ;
44 ; Output:
45 ; function result - 1-complete record found, 0-incomplete record
46 ; DGENR - Array of current NTR HISTORY file record field values.
47 ; See $$GETREC^DGNTAPI for array specifications.
48 ;
49 N DGIEN
50 N DGRSLT
51 N DGX
52 ;
53 I '$G(DGDFN) Q 0
54 ;
55 S DGENR=$G(DGENR)
56 I DGENR']"" S DGENR="DGNTARR"
57 ;
58 S DGRSLT=0
59 S DGIEN=+$$GETPRIM^DGNTAPI(DGDFN)
60 I ($$GETREC^DGNTAPI(DGIEN,DGENR)&($G(@DGENR@("VDT"))]"")) D
61 . S DGRSLT=1
62 . ;return only internal values
63 . F DGX="IND","STAT","NTR","AVI","SUB","VER","HNC" D
64 . . S @DGENR@(DGX)=$P(@DGENR@(DGX),"^")
65 Q DGRSLT
66 ;
67GETSTAT(DGDFN) ;get the screening status
68 ;
69 ; Input:
70 ; DGDFN - IEN of patient in the PATIENT (#2) file
71 ;
72 ; Output:
73 ; function result - internal value of SCREENING STATUS field (#.03)
74 ;
75 N DGNT
76 I +$G(DGDFN)>0,+$$GETCUR^DGNTAPI(DGDFN,"DGNT")
77 Q (+$G(DGNT("STAT")))
78 ;
79FILEHNC(DGDFN) ;entry point for applications that need to complete the
80 ;Head/Neck diagnosis question. Only file an entry if the Screening
81 ;Status is "3" - Pending Diagnosis.
82 ;This API is supported by DBIA #3456
83 ;
84 ; Input:
85 ; DGDFN - IEN of patient in the PATIENT (#2) file
86 ;
87 ; Output:
88 ; function result - "0"-nothing filed, "1"-success
89 ;
90 N DGNT,DGRSLT
91 S DGRSLT=0
92 I +$G(DGDFN)>0,+$$GETCUR^DGNTAPI(DGDFN,"DGNT"),+$G(DGNT("STAT"))=3 D
93 . S DGNT("HNC")="Y"
94 . S DGNT("HDT")=$$NOW^XLFDT
95 . S DGNT("HUSR")=DUZ
96 . S DGNT("HSIT")=$$SITE^DGNTUT
97 . S DGRSLT=$$FILENTR^DGNTAPI(DGDFN,.DGNT,1)
98 Q DGRSLT
99 ;
100VALID(DGIP,DGERR) ;Validate input parameters before filing
101 ; Input
102 ; DGIP - array of input parameters to validate passed by reference
103 ; DGERR - error parameter passed by reference
104 ;
105 ; Output
106 ; function output - 0:invalid, 1:valid
107 ; DGERR - error message
108 ;
109 N DGVLD ;function return value
110 N DGFXR ;node name to field xref array
111 N DGREQ ;array of required parameters
112 N DGN ;array node name
113 N DGFILE ;file number
114 ;
115 S DGVLD=1
116 S DGN=""
117 S DGFILE=28.11
118 ;build field/node xref and required fields array
119 D BLDARR(.DGFXR,.DGREQ)
120 ;
121 D ;first invalid condition will exit block structure
122 . ;check for required parameters
123 . F S DGN=$O(DGREQ(DGN)) Q:DGN="" I $G(DGIP(DGN))']"" D Q
124 . . S DGVLD=0,DGERR=$$GET1^DID(DGFILE,DGFXR(DGN),,"LABEL")_" REQUIRED"
125 . ;quit if any missing required parameters
126 . Q:'DGVLD
127 . ;check value validity
128 . F S DGN=$O(DGIP(DGN)) Q:DGN="" I $D(DGFXR(DGN)),'$$TESTVAL(DGFILE,DGFXR(DGN),$P(DGIP(DGN),U)) D Q
129 . . S DGVLD=0,DGERR=$$GET1^DID(DGFILE,DGFXR(DGN),,"LABEL")_" NOT VALID"
130 Q DGVLD
131 ;
132BLDARR(DGFLDA,DGREQA) ;Read in $T(XREF) lines and build name/field xref
133 ;array and required fields array.
134 ; Input
135 ; DGFLDA - array name passed by reference
136 ; DGREQA - array name of required fields passed by reference
137 ;
138 ; Output
139 ; DGFLDA - field array node xref
140 ; DGREQA - required fields array
141 ;
142 N DGOFF ;offset value used with $T
143 N DGLINE ;line retrieved by $T(XREF+offset)
144 ;
145 F DGOFF=1:1 S DGLINE=$T(XREF+DGOFF) Q:DGLINE="" D
146 . S DGFLDA($P(DGLINE,";",3))=$P(DGLINE,";",4)
147 . I +$P(DGLINE,";",5) S DGREQA($P(DGLINE,";",3))=""
148 Q
149 ;
150TESTVAL(DGFIL,DGFLD,DGVAL) ;Used to determine if a field value is valid
151 ;
152 ; Input
153 ; DGFIL - file number
154 ; DGFLD - field number
155 ; DGVAL - field value to be validated
156 ;
157 ; Output
158 ; Function value: 1:field value is valid, 0:field value is invalid
159 ;
160 N DGVALEX ;external value after conversion
161 N DGRSLT ;result of CHK^DIE
162 N VALID ;function result
163 ;
164 S VALID=1
165 I DGVAL'="" D
166 . S DGVALEX=$$EXTERNAL^DILFD(DGFIL,DGFLD,"F",DGVAL)
167 . I DGVALEX="" S VALID=0 Q
168 . ;
169 . I $$GET1^DID(DGFIL,DGFLD,"","TYPE")'="POINTER" D
170 . . D CHK^DIE(DGFIL,DGFLD,,DGVALEX,.DGRSLT) I DGRSLT="^" S VALID=0 Q
171 Q VALID
172 ;
173XREF ;;array node name;field#;required param;description
174 ;;DFN;.01;1;patient IEN
175 ;;NTR;.04;1;NTR exposure code
176 ;;AVI;.05;0;Military Aviator prior to 1/31/55
177 ;;SUB;.06;0;Submarine Training prior to 1/1/65
178 ;;EDT;.07;0;Date/Time entered
179 ;;EUSR;.08;0;Entered by
180 ;;VER;1.01;0;verification method
181 ;;VDT;1.02;0;Date/Time verified
182 ;;VUSR;1.03;0;verified by
183 ;;VSIT;1.04;0;Site verifying Documentation
184 ;;HNC;2.01;0;Head/Neck Cancer DX
185 ;;HDT;2.02;0;Date/Time diagnosis verified
186 ;;HUSR;2.03;0;diagnosis verified by
187 ;;HSIT;2.04;0;Site verifying DX
Note: See TracBrowser for help on using the repository browser.