source: WorldVistAEHR/trunk/r/INCOME_VERIFICATION_MATCH-IVM/IVMLDEM3.m@ 895

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

initial load of WorldVistAEHR

File size: 4.0 KB
Line 
1IVMLDEM3 ;ALB/KCL - IVM DEMOGRAPHIC NON-UPLOADABLE FIELDS ; 15-APR-94
2 ;;Version 2.0 ; INCOME VERIFICATION MATCH ;**5**; 21-OCT-94
3 ;;Per VHA Directive 10-93-142, this routine should not be modified.
4 ;
5 ;
6EN ; - main entry point for IVM DEMOGRAPHIC NON-UPLOADABLE
7 D EN^VALM("IVM DEMOGRAPHIC NON-UPLOADABLE")
8 Q
9 ;
10 ;
11HDR ; - header code for list manager display
12 S IVMBLNK="",$P(IVMBLNK," ",45)=""
13 ;
14 ; - header line 1
15 S VALMHDR(1)="Patient: "_$E($E($P(^DPT(DFN,0),"^"),1,20)_" "_"("_$E($P(^DPT(DFN,0),"^",9),6,9)_")"_IVMBLNK,1,35)_" "_"Non-uploadable Demographic Fields"
16 ;
17 ; - header line 2
18 S VALMHDR(2)=" "
19 Q
20 ;
21 ;
22INIT ; - init variables and list array
23 ;
24 ; Input: IVMDA2 -- Pointer to case record in file #301.5
25 ; IVMDA1 -- Pointer to PID msg in sub-file #301.501
26 ; DFN -- Pointer to patient in file #2
27 ;
28 ;
29 ; - flag used for delete demographic field action (DF)
30 S IVMWHERE="NON"
31 S IVMSTAT2=""
32 K ^TMP("IVMNONUP",$J)
33 S IVMBL="",$P(IVMBL," ",58)="",IVMCNTR=0,IVM27=0
34 D DEM^VADPT,ADD^VADPT S IVMSTATE=$P(VAPA(5),"^")
35 F IVMDA=0:0 S IVMDA=$O(^IVM(301.5,IVMDA2,"IN",IVMDA1,"DEM",IVMDA)) Q:'IVMDA D
36 .;
37 .; - grab node with IVM-supplied data
38 .S IVMDEMO=$G(^IVM(301.5,IVMDA2,"IN",IVMDA1,"DEM",IVMDA,0)) I IVMDEMO="" Q
39 .;
40 .; - quit if data element is uploadable
41 .S IVMTABLE=$G(^IVM(301.92,+$P(IVMDEMO,"^"),0))
42 .Q:$P(IVMTABLE,"^",3)=1
43 .;
44 .; - if ivm state data then set IVMSTAT2 for decoding county code
45 .I $P(IVMTABLE,"^")["STATE" S IVMSTAT2=$P(IVMDEMO,"^",2)
46 .;
47 .S IVMCNTR=IVMCNTR+1
48 .;
49 .; - primary eligibility code
50 .S:$P(IVMDEMO,"^")=27 IVM27=IVM27+1
51 .;
52 .; - extract DHCP value in displayable format
53 .S IVMDHCP="" X:$D(^IVM(301.92,$P(IVMDEMO,"^"),2)) ^(2) S IVMDHCP=Y
54 .;
55 .; - build index record to use for processing as
56 .; ctr is line # and ctr1 is entry #
57 .; ^tmp("ivmnonup",$j,"idx",ctr,ctr1)=dfn^da(2)^da(1)^da^ivm data^pointer to file (#1)^dhcp field number^dhcp field name
58 .;
59 .S IVMCNTR1=$S(IVM27<2:IVMCNTR,1:IVMCNTR-IVM27+1)
60 .S ^TMP("IVMNONUP",$J,"IDX",IVMCNTR,IVMCNTR1)=DFN_"^"_IVMDA2_"^"_IVMDA1_"^"_IVMDA_"^"_$P(IVMDEMO,"^",2)_"^"_$P(IVMTABLE,"^",4)_"^"_$P(IVMTABLE,"^",5)_"^"_$P(IVMTABLE,"^")
61 .;
62 .; - build list manager display line
63 .D WRITLINE($P(IVMTABLE,"^")_"^"_IVMDHCP_"^"_$P(IVMDEMO,"^",2),IVMCNTR)
64 ;
65 ;
66 I '$O(@VALMAR@(0)) D
67 .;
68 .; - check for uploadable fields, if no fields do DELETE
69 .I '$$DEMO^IVMLDEM5(IVMDA2,IVMDA1,1) D DELETE^IVMLDEM5(IVMDA2,IVMDA1,IVMNAME)
70 .;
71 .; - if uploadable fields set array field from 'YES' to 'NO' for list manager display
72 .I $$DEMO^IVMLDEM5(IVMDA2,IVMDA1,1) S $P(^TMP("IVMDUPL",$J,IVMNAME,IVMDA2,IVMDA1),"^",5)="NO"
73 .;
74 .; - display msg to user that no uploadable data to view
75 .D KILL^VALM10(1)
76 .D KILL^VALM10(2)
77 .S @VALMAR@(1,0)=" "
78 .S @VALMAR@(2,0)="There is no non-uploadable demographic information to view."
79 .S IVMCNTR=2
80 ;
81 ; - list manager variable as number of lines in the list
82 S VALMCNT=IVMCNTR
83 ;
84 ;
85INITQ ; - clean up variables
86 D KVA^VADPT ; kill all variables defined by VADPT routine
87 K IVMBL,IVMBLNK,IVMCNTR,IVMCNTR1,IVMDA,IVMDEMO,IVMDHCP,IVMFIELD
88 K IVMSTAT2,IVMSTATE,IVMTABLE,IVM27
89 Q
90 ;
91 ;
92WRITLINE(IVMLINE,IVMNUM) ; - write line out for list manager display
93 ;
94 ; Input: IVMLINE -- as the line for display:
95 ; dhcp field name^dhcp field value^ivm field value
96 ; IVMNUM -- as the line number
97 ; Output: None
98 ;
99 N IVMLN,IVMOUT1,IVMOUT2,IVMNUM1
100 S IVMOUT1=$P(IVMLINE,"^",2)
101 I $P(IVMTABLE,"^",7) S IVMOUT1=$$OUTTR^IVMUFNC(IVMOUT1,IVMTABLE,IVMSTATE)
102 S:IVMOUT1="" IVMOUT1="(* NONE ON FILE *)"
103 S IVMOUT2=$$OUTTR^IVMUFNC($P(IVMLINE,"^",3),IVMTABLE,IVMSTAT2)
104 S IVMLN=$E($P(IVMLINE,"^",1)_IVMBL,1,30)_" "_$E(IVMOUT1_IVMBL,1,20)_" "_$E(IVMOUT2_IVMBL,1,20)
105 ;
106 ; - highlight IVM field value
107 D CNTRL^VALM10(IVMNUM,58,22,IOINHI,IOINORM)
108 I $P(IVMDEMO,"^")=27,IVM27>1 S @VALMAR@(IVMNUM,0)=IVMBL_$E(IVMOUT2_IVMBL,1,20) Q
109 S IVMNUM1=$S(IVM27>1:IVMNUM-IVM27+1,1:IVMNUM)
110 S @VALMAR@(IVMNUM,0)=$E(IVMNUM1_" ",1,3)_IVMLN
111 Q
112 ;
113 ;
114HELP ; - help code
115 S X="?" D DISP^XQORM1 W !!
116 Q
117 ;
118EXIT ; - exit code
119 K ^TMP("IVMNONUP",$J)
120 Q
Note: See TracBrowser for help on using the repository browser.