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

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1DGACT ;ALB/CAW - Active check for facility TS or Specialty ; 7/27/94
2 ;;5.3;Registration;**64,683,729**;Aug 13, 1993;Build 59
3 ;
4 ;
5ACTIVE(FILE,IEN,DGDT) ; Extrinsic function to determine if TS entry is active
6 ;
7 ; Input -- FILE to determine if checking facility TS or TS
8 ; FACILITY TREATING SPECIALTY (45.7)
9 ; SPECIALTY (42.4)
10 ; IEN is the internal IFN of whichever file passed in
11 ; DGDT as 'as of' date (uses DT if undefined)
12 ; Output -- 1 if active, 0 otherwise
13 ;
14 N DGID,Y,X
15 S DGID=$S($G(DGDT):DGDT,1:DT)
16 S DGID=$S('$P(DGID,".",2):(DGID)_.2359,1:(DGID)),DGID=-DGID
17 S Y=0
18 S ID=$O(^DIC(FILE,IEN,"E","ADATE",DGID)) G:'ID ACTIVEQ
19 S ID=$O(^DIC(FILE,IEN,"E","ADATE",ID,0))
20 S X=$G(^DIC(FILE,IEN,"E",ID,0)) I 'X G ACTIVEQ
21 I $P(X,"^",2)=1 S Y=1
22ACTIVEQ Q $S(Y:1,1:0)
23 ;
24TSDATA(FILE,IEN,ARRAY,DGDT) ; Call to return TS data
25 ;
26 ; Input -- FILE to determine if checking facility TS or TS
27 ; FACILITY TREATING SPECIALTY (45.7)
28 ; SPECIALTY (42.4)
29 ; IEN is the internal IFN of whichever file passed in
30 ; DGDT as 'as of' date (uses DT if undefined)
31 ; Output -- 1 if entry exists, -1 otherwise
32 ;** Responsibility of calling routine to handle undefined array when -1
33 ; ARRAY(0) := 1 if active, 0 otherwise
34 ; If FILE=45.7
35 ; ARRAY(1) := Name
36 ; ARRAY(2) := Specialty ptr to 42.4 file^Specialty name
37 ; ARRAY(3) := Abbreviation
38 ; ARRAY(4) := Service ptr to 49 file^Service name
39 ; If FILE=42.4
40 ; ARRAY(1) := Name
41 ; ARRAY(2) := Print name
42 ; ARRAY(3) := Service (set value)^Service (set value) name
43 ; ARRAY(4) := Ask Psychiatric Question? (set value)^null/yes/no
44 ; ARRAY(5) := Billing Rate Bedsection^
45 ; ARRAY(6) := MPCR Account
46 ; ARRAY(7) := PTF Code (alpha-numeric)
47 ;
48 ;
49 K ARRAY N DGI
50 S FILE=$G(FILE),IEN=$G(IEN),DGDT=$G(DGDT)
51 I '$D(^DIC(FILE,+$G(IEN),0)) Q -1
52 I FILE=45.7 D
53 . F DGI=0:1:4 S ARRAY(DGI)=""
54 . S ARRAY(0)=$$ACTIVE(FILE,IEN,DGDT)
55 . S ARRAY(1)=$$GET1^DIQ(45.7,IEN_",",.01)
56 . S ARRAY(2)=$$GET1^DIQ(45.7,IEN_",",1,"I")_"^"_$$GET1^DIQ(45.7,IEN_",",1)
57 . S ARRAY(3)=$$GET1^DIQ(45.7,IEN_",",99)
58 . S ARRAY(4)=$$GET1^DIQ(45.7,IEN_",",2,"I")_"^"_$$GET1^DIQ(45.7,IEN_",",2)
59 I FILE=42.4 D
60 . F DGI=1:1:7 S ARRAY(DGI)=""
61 . S ARRAY(0)=$$ACTIVE(FILE,IEN,DGDT)
62 . S ARRAY(1)=$$GET1^DIQ(42.4,IEN_",",.01)
63 . S ARRAY(2)=$$GET1^DIQ(42.4,IEN_",",1)
64 . S ARRAY(3)=$$GET1^DIQ(42.4,IEN_",",3,"I")_"^"_$$GET1^DIQ(42.4,IEN_",",3)
65 . S ARRAY(4)=$$GET1^DIQ(42.4,IEN_",",4,"I")_"^"_$$GET1^DIQ(42.4,IEN_",",4)
66 . S ARRAY(5)=$$GET1^DIQ(42.4,IEN_",",5,"I")_"^"_$$GET1^DIQ(42.4,IEN_",",5)
67 . S ARRAY(6)=$$GET1^DIQ(42.4,IEN_",",6)
68 . S ARRAY(7)=$$GET1^DIQ(42.4,IEN_",",7)
69TSDATAQ Q 1
Note: See TracBrowser for help on using the repository browser.