source: WorldVistAEHR/trunk/r/PATIENT_DATA_EXCHANGE-VAQ/VAQDIS43.m@ 691

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

initial load of WorldVistAEHR

File size: 4.3 KB
RevLine 
[613]1VAQDIS43 ;ALB/JRP/JFP - PRINT ACTION PROFILE (CONT);30APR92
2 ;;1.5;PATIENT DATA EXCHANGE;;NOV 17, 1993
3LONG ;PRINT LONG FORMAT
4 S VAQPOP=0
5 D SORT Q:VAQPOP=1
6 D REFILL
7 D LSORT
8 D EXIT
9 QUIT
10 ;
11LSORT S (Z1,Z2)=""
12 F S Z1=$O(^TMP("VAQSORT",$J,Z1)) Q:Z1="" D LG0
13 QUIT
14LG0 F S Z2=$O(^TMP("VAQSORT",$J,Z1,Z2)) Q:Z2="" D LG1
15 QUIT
16 ;
17LG1 ; -- Line 1
18 S SEQ=$G(^TMP("VAQSORT",$J,Z1,Z2))
19 S VAQRXN=$G(@XTRCT@("VALUE",52,.01,SEQ))
20 S X=$$SETSTR^VALM1("RX #: "_VAQRXN,"",1,79)
21 D TMP^VAQDIS20
22LG2 ;
23 S X=$$SETSTR^VALM1($G(@XTRCT@("VALUE",52,6,SEQ)),"",1,44)
24 S X=$$SETSTR^VALM1("SIG: "_$G(@XTRCT@("VALUE",52,10,SEQ)),X,45,34)
25 D TMP^VAQDIS20
26LG3 ;
27 S X=$$SETSTR^VALM1("QTY: "_$G(@XTRCT@("VALUE",52,7,SEQ)),"",3,21)
28 S X=$$SETSTR^VALM1("# OF REFILLS: "_$G(@XTRCT@("VALUE",52,9,SEQ)),X,23,22)
29 S VAQTMP=$$DATE^VAQUTL99($G(@XTRCT@("VALUE",52,1,SEQ)))
30 S TMP=$$DOBFMT^VAQUTL99(VAQTMP,0)
31 S:(TMP=-1) TMP=""
32 S:(TMP'="") $P(TMP,"-",3)=$E($P(TMP,"-",3),3,4)
33 S VAQTMP=$$DATE^VAQUTL99($G(@XTRCT@("VALUE",52,26,SEQ)))
34 S TMP1=$$DOBFMT^VAQUTL99(VAQTMP,0)
35 S:(TMP1=-1) TMP=""
36 S:(TMP1'="") $P(TMP1,"-",3)=$E($P(TMP1,"-",3),3,4)
37 S X=$$SETSTR^VALM1("ISSUE/EXPR: "_TMP_" / "_TMP1,X,45,34)
38 D TMP^VAQDIS20
39LG4 ;
40 S X=$$SETSTR^VALM1("PHYS: "_$G(@XTRCT@("VALUE",52,4,SEQ)),"",3,27)
41 S X=$$SETSTR^VALM1("CLERK: "_$G(@XTRCT@("VALUE",52,16,SEQ)),X,30,15)
42 S VAQTMP=$$DATE^VAQUTL99($G(@XTRCT@("VALUE",52,22,SEQ)))
43 S TMP=$$DOBFMT^VAQUTL99(VAQTMP,0)
44 S:(TMP=-1) TMP=""
45 S:(TMP'="") $P(TMP,"-",3)=$E($P(TMP,"-",3),3,4)
46 S X=$$SETSTR^VALM1("FILL DATE: "_TMP,X,45,34)
47 D TMP^VAQDIS20
48LG5 ;
49 S VAQTMP=$$DATE^VAQUTL99($G(@XTRCT@("VALUE",52.1,.01,SEQ)))
50 S TMP=$$DOBFMT^VAQUTL99(VAQTMP,0)
51 S:(TMP=-1) TMP=""
52 S:(TMP'="") $P(TMP,"-",3)=$E($P(TMP,"-",3),3,4)
53 S X=$$SETSTR^VALM1("REFILLED: "_TMP,"",3,79)
54 D TMP^VAQDIS20
55LG6 ;
56 S X=$$SETSTR^VALM1("REMARKS: "_$G(@XTRCT@("VALUE",52,12,SEQ)),"",3,79)
57 D TMP^VAQDIS20
58LG7 ;
59 S X=$$SETSTR^VALM1("DIVISION: "_$G(@XTRCT@("VALUE",52,20,SEQ)),"",3,38)
60 S X=$$SETSTR^VALM1($G(@XTRCT@("VALUE",52,100,SEQ)),X,40,20)
61 S VAQTMP=$G(@XTRCT@("VALUE",52,9,SEQ))
62 S VAQRFL=$S($G(VAQRF(VAQRXN))="":0,1:$G(VAQRF(VAQRXN)))
63 S VAQREM=VAQTMP-VAQRFL
64 S X=$$SETSTR^VALM1(VAQREM_" REFILL"_$S(VAQREM=1:"",1:"S"),X,60,17)
65 D TMP^VAQDIS20
66 D BLANK^VAQDIS20
67 QUIT
68 ;
69SHORT ; -- Print short format
70 S VAQPOP=0
71 D SORT Q:VAQPOP=1
72 D REFILL
73 D SSORT
74 D EXIT
75 QUIT
76 ;
77SSORT S (Z1,Z2)=""
78 F S Z1=$O(^TMP("VAQSORT",$J,Z1)) Q:Z1="" D SH0
79 QUIT
80SH0 F S Z2=$O(^TMP("VAQSORT",$J,Z1,Z2)) Q:Z2="" D SH1
81 QUIT
82 ;
83SH1 ; -- Line 1
84 S SEQ=$G(^TMP("VAQSORT",$J,Z1,Z2))
85 S VAQRXN=$G(@XTRCT@("VALUE",52,.01,SEQ))
86 S X=$$SETSTR^VALM1(VAQRXN,"",1,7)
87SH2 ;
88 S X=$$SETSTR^VALM1($G(@XTRCT@("VALUE",52,6,SEQ)),X,8,37)
89SH3 ;
90 S VAQTMP=$G(@XTRCT@("VALUE",52,100,SEQ))
91 S X=$$SETSTR^VALM1($E(VAQTMP,1),X,47,2)
92SH4 ;
93 S VAQTMP=$G(@XTRCT@("VALUE",52,7,SEQ))
94 S VAQINF=$J(VAQTMP,5)
95 S X=$$SETSTR^VALM1(VAQINF,X,49,5)
96SH5 ;
97 S VAQTMP=$G(@XTRCT@("VALUE",52,1,SEQ))
98 S VAQTMP=$$DATE^VAQUTL99(VAQTMP)
99 S TMP=$$DOBFMT^VAQUTL99(VAQTMP,0)
100 S:(TMP=-1) TMP=""
101 S:(TMP'="") $P(TMP,"-",3)=$E($P(TMP,"-",3),3,4)
102 S X=$$SETSTR^VALM1(TMP,X,56,10)
103SH6 ;
104 S VAQTMP=$G(@XTRCT@("VALUE",52,101,SEQ))
105 S VAQTMP=$$DATE^VAQUTL99(VAQTMP)
106 S TMP=$$DOBFMT^VAQUTL99(VAQTMP,0)
107 S:(TMP=-1) TMP=""
108 S:(TMP'="") $P(TMP,"-",3)=$E($P(TMP,"-",3),3,4)
109 S X=$$SETSTR^VALM1(TMP,X,66,10)
110SH7 ;
111 S VAQTMP=$G(@XTRCT@("VALUE",52,9,SEQ))
112 S VAQRFL=$S($G(VAQRF(VAQRXN))="":0,1:$G(VAQRF(VAQRXN)))
113 S VAQREM=VAQTMP-VAQRFL
114 S X=$$SETSTR^VALM1("("_VAQREM_")",X,76,3)
115 D TMP^VAQDIS20
116SH20 ; -- Line 2
117 S X=$$SETSTR^VALM1($G(@XTRCT@("VALUE",52,10,SEQ)),"",10,79)
118 D TMP^VAQDIS20
119 D BLANK^VAQDIS20
120 Q
121 ;
122SORT ; -- sorts medication in alpha or by name
123 S SEQ=""
124 F J=1:1 S SEQ=$O(@XTRCT@("VALUE",52,.01,SEQ)) Q:SEQ="" D
125 .S VAQRXN=$G(@XTRCT@("VALUE",52,.01,SEQ))
126 .S VAQMED=$G(@XTRCT@("VALUE",52,6,SEQ))
127 .S ^TMP("VAQSORT",$J,VAQMED,VAQRXN)=SEQ
128 I J=1 D
129 .S X=$$SETSTR^VALM1("*** There is no Pharmacy Information",1,79)
130 .D TMP^VAQDIS20
131 .S VAQPOP=1
132 QUIT
133 ;
134REFILL ; -- Counts the number of refills by perscription number
135 S SEQ=""
136 F S SEQ=$O(@XTRCT@("ID",52.1,.01,SEQ)) Q:SEQ="" D
137 .S VAQRXNO=$G(@XTRCT@("ID",52.1,.01,SEQ))
138 .I '$D(VAQRF(VAQRXNO)) S VAQRF(VAQRXNO)=0
139 .S VAQRF(VAQRXNO)=VAQRF(VAQRXNO)+1
140 K SEQ,VAQRXNO
141 QUIT
142 ;
143EXIT ; -- Cleans up variables
144 K Z1,Z2,SEQ,TMP,TMP1,J
145 K VAQRXN,VAQTMP,VAQRFL,VAQREM,VAQINF,VAQMED,VAQRXNO
146 K ^TMP("VAQSORT",$J),VAQRF
147 QUIT
148 ;
Note: See TracBrowser for help on using the repository browser.