source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQDIS11.m@ 1284

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1VAQDIS11 ;ALB/JFP - PDX,SELECTION SCREEN FOR DISPLAY BY PATIENT;01MAR93
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3EP ; -- Main entry point for the list processor
4 K XQORS,VALMEVL
5 N VAQSSN,VAQPAT,VAQFLAG,VAQECNT,VAQRSLT,VAQUNSOL,X0,STATUS,TRDE
6 D EN^VALM("VAQ DIS PATIENT PDX9") ; -- Protocol = VAQ PDX9 (MENU)
7 QUIT
8 ;
9INIT ; -- Builds array of PDX trans for the patient entered (SSN) or name
10 K ^TMP("VAQD1",$J),^TMP("VAQIDX",$J)
11 ;
12 S TRDE="",(VAQECNT,VALMCNT)=0
13 S VAQPAT=$P($G(^VAT(394.61,+VAQDFN,"QRY")),U,1)
14 S VAQSSN=$P($G(^VAT(394.61,+VAQDFN,"QRY")),U,2)
15 I (VAQSSN="")&(VAQPAT="") D MSG1 QUIT
16 ;
17 D STATPTR^VAQUTL95 ; -- Sets PDX status pointers (vaq-rslt,vaq-unsol)
18MAIN ; -- Main processing loop
19 F S TRDE=$O(^VAT(394.61,$S(VAQSSN'="":"SSN",1:"NAME"),$S(VAQSSN'="":VAQSSN,1:VAQPAT),TRDE)) Q:TRDE="" D SETD
20 I VAQECNT=0 D MSG2 QUIT
21 QUIT
22 ;
23SETD ; -- Set data for display in list processor
24 S VAQCSTAT=$P($G(^VAT(394.61,TRDE,0)),U,2)
25 ; -- Filter out transaction without results
26 I ((VAQCSTAT)'=VAQRSLT)&((VAQCSTAT)'=VAQUNSOL) QUIT
27 ; -- Filter out transactions marked as purged OR excides life cap
28 S VAQFLAG=$$EXPTRN^VAQUTL97(TRDE)
29 Q:VAQFLAG=1
30 ;
31 S X0=$$TRNDATA^VAQUTL92(TRDE) ; -- Extracts data from transaction file
32 S STATUS=$S(VAQCSTAT'="":$P($G(^VAT(394.85,VAQCSTAT,0)),U,2),1:" ")
33 S:VAQADT'="" DATETIME=VAQADT_" (Rs)"
34 S:VAQADT="" DATETIME=VAQRDT_" (Rq)"
35 S VAQECNT=VAQECNT+1
36 S X=$$SETFLD^VALM1(VAQECNT,"","ENTRY")
37 S X=$$SETFLD^VALM1(VAQADOM,X,"DOMAIN")
38 S X=$$SETFLD^VALM1(DATETIME,X,"DATE")
39 S X=$$SETFLD^VALM1(VAQTRN,X,"TRNO")
40 D TMP
41 S X=$$SETSTR^VALM1(" ","",1,80) D TMP ; -- null line
42 D KILLTRN^VAQUTL92 ; -- Cleans up variables set in TRNDATA
43 QUIT
44 ;
45HD ; -- Make header line for list processor
46 S X0=$$TRNDATA^VAQUTL92(VAQDFN)
47 D HD1^VAQEXT02
48 D KILLTRN^VAQUTL92
49 QUIT
50 ;
51SEL ; -- Selects patient to display, checks sensative patient
52 N VALMY,SDI,SDAT
53 S:'$D(VAQBCK) VAQBCK=0
54 D EN^VALM2($G(XQORNOD(0)),"S")
55 Q:'$D(VALMY)
56 S SDI=""
57 S SDI=$O(VALMY(SDI)) Q:SDI=""
58 S SDAT=$G(^TMP("VAQIDX",$J,SDI))
59 S VAQTRN=$P(SDAT,U,2),DFN=""
60 S (VAQDFN,DFN)=$O(^VAT(394.61,"B",VAQTRN,DFN))
61 I $P($G(^VAT(394.61,DFN,0)),U,4)=1 D WORKLD
62 D EP^VAQDIS15 ; -- Display segments
63 I VAQBCK=1 K VALMBCK QUIT
64 D INIT
65 S VALMBCK="R"
66 QUIT
67 ;
68TMP ; -- Set the array used by list processor
69 S VALMCNT=VALMCNT+1
70 S ^TMP("VAQD1",$J,VALMCNT,0)=$E(X,1,79)
71 S ^TMP("VAQD1",$J,"IDX",VALMCNT,VAQECNT)=""
72 S ^TMP("VAQIDX",$J,VAQECNT)=VALMCNT_"^"_VAQTRN
73 QUIT
74 ;
75WORKLD ; -- Updates workload file
76 S X=$$WORKDONE^VAQADS01("SNSTVE",DFN,$G(DUZ))
77 I X<0 W !,"Error updating workload file (SNSTVE)... "_$P(X,U,2)
78 QUIT
79 ;
80MSG1 ; -- Message 1
81 S VAQTRN=0,X=$$SETSTR^VALM1(" ","",1,79) D TMP
82 S X=$$SETSTR^VALM1(" ** Insufficient Information for Patient Look-up...","",1,80) D TMP
83 QUIT
84 ;
85MSG2 ; -- Message 2
86 S VAQTRN=0,X=$$SETSTR^VALM1(" ","",1,79) D TMP
87 S X=$$SETSTR^VALM1(" ** PDX results not found for patient entered... ","",1,80) D TMP
88 QUIT
89 ;
90EXIT ; -- Note: The list processor cleans up its own variables.
91 ; All other variables cleaned up here.
92 ;
93 K VAQADFL ; -- set in VAQDIS01 (display min)
94 K VAQSSN,VAQPAT,VAQFLAG,VAQECNT,VAQRSLT,VAQUNSOL,X0,STATUS,TRDE,VAQBCK
95 K ENTRY,DATETIME,VAQECNT
96 K ^TMP("VAQD1",$J),^TMP("VAQIDX",$J)
97 QUIT
98 ;
99END ; -- End of code
100 QUIT
Note: See TracBrowser for help on using the repository browser.