source: FOIAVistA/trunk/r/ENROLLMENT_APPLICATION_SYSTEM-EAS/EASEZPVU.m@ 677

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

initial load of FOIAVistA 6/30/08 version

File size: 2.2 KB
Line 
1EASEZPVU ;ALB/GTS/CMF - MT PICKER FOR EZ/EZR PRINT
2 ;;1.0;ENROLLMENT APPLICATION SYSTEM;**57**;Mar 15, 2001
3 ;
4 Q
5PICK(EASDFN,EASMTIEN) ;validate or pick mtien for printing
6 ; Input: EASDFN - POINTER TO PATIENT FILE (#2) - required
7 ; EASMTIEN - POINTER TO MEANS TEST FILE (#408.31 - optional
8 ; Output: RESULT - valid mt pointer, or null
9 N RESULT,MTIEN,DIC,D,X,Y,DTOUT,DUOUT,EASSORT
10 S RESULT=""
11 ; if means test ien, then return it
12 S MTIEN=$G(EASMTIEN)
13 S MTIEN=$S($D(^DGMT(408.31,+MTIEN)):+MTIEN,MTIEN=0:0,MTIEN=-1:-1,1:"")
14 I (+MTIEN>0)!(MTIEN=-1) Q MTIEN
15 ;
16 ; if no means test ien, then ask user for one
17 D GETMTDAT(EASDFN)
18 I $D(EASSORT) D
19 .;display sort array here!
20 .D DISPLAY
21 .;lookup filtered by sort array
22 .S DIC=408.31
23 .S DIC(0)="AEMQ"
24 .S DIC("A")="Select DATE OF TEST:"
25 .S DIC("S")="I $D(EASSORT($P(^(0),U),Y))"
26 .S D="ADFN"_EASDFN_"^B"
27 .D MIX^DIC1
28 .S RESULT=+Y
29 Q RESULT
30 ;
31GETMTDAT(EASDFN) ;sort primary tests for printing selection
32 ;
33 ; Input: EASDFN - Patient file IEN (DFN)
34 ; Output: EASSORT - Array of Means Tests in the following format:
35 ; EASSORT(DATE,MTIEN)=MT IEN^Date of Test^Status Name^Status Code^Source
36 ;
37 ;check for futures
38 ; means test
39 D SORT($$FUT^DGMTU(EASDFN,,1),"NO")
40 ; copay test
41 D SORT($$FUT^DGMTU(EASDFN,,2),"NO")
42 ; ltc copay exemption test
43 D SORT($$FUT^DGMTU(EASDFN,,4),"NO")
44 ;look for current
45 ; means test
46 D SORT($$LST^DGMTU(EASDFN,,1),"YES")
47 ; copay test
48 D SORT($$LST^DGMTU(EASDFN,,2),"YES")
49 ; ltc copay exemption test
50 D SORT($$LST^DGMTU(EASDFN,,4),"YES")
51 Q
52 ;
53SORT(RETURN,PRIMARY) ;sort mt status string
54 N DATE,MTIEN
55 I +RETURN=0 Q
56 S DATE=$P(RETURN,U,2)
57 S MTIEN=$P(RETURN,U,1)
58 S:$$GET1^DIQ(408.31,MTIEN_",",2)=PRIMARY EASSORT(DATE,MTIEN)=RETURN
59 Q
60 ;
61DISPLAY ; eassort array
62 N MTDT,MTIEN,MTIENS
63 W !?3,"Choose from:"
64 S MTDT=""
65 F S MTDT=$O(EASSORT(MTDT)) Q:MTDT="" D
66 .S MTIEN=""
67 .F S MTIEN=$O(EASSORT(MTDT,MTIEN)) Q:MTIEN="" D
68 ..S MTIENS=MTIEN_","
69 ..W !?3,MTDT_" "
70 ..W $$GET1^DIQ(408.31,MTIENS,.01)_" " ;test date
71 ..W $$GET1^DIQ(408.31,MTIENS,.019)_" " ;type of test
72 ..W $$GET1^DIQ(408.31,MTIENS,.03)_" " ;status
73 ..W $$GET1^DIQ(408.31,MTIENS,.23)_" " ;source of test
74 ..W $S($$GET1^DIQ(408.31,MTIENS,2)="YES":"PRIMARY",1:"NOT PRIMARY")
75 ..Q
76 .Q
77 Q
78 ;
Note: See TracBrowser for help on using the repository browser.