source: WorldVistAEHR/trunk/r/PCE_PATIENT_CARE_ENCOUNTER-AUTN-EFDP-PX-VSIT--PXRM/PXBGPOV2.m@ 1430

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

initial load of WorldVistAEHR

File size: 5.6 KB
Line 
1PXBGPOV2 ;ISL/JVS - DOUBLE ?? GATHERING OF DIAGNOSES ;8/10/04 1:49pm
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**1,5,11,136,149,124**;Aug 12, 1996
3 ;
4 W !,"THIS IS NOT AN ENTRY POINT" Q
5DOUBLE(FROM) ;--Entry point
6 ; WHAT = The same WHAT as sent in from the API
7 ; FROM = Exactly which prompt is asking for the list
8 ; SCREEN = Same as the DIC("S") screen used by file man
9 ; START = The starting point as to what to look up
10 ;
11 N FILE,FIELD,TITLE,HEADING,SUB,CODE,NAME,START,SCREEN,BACK,NUM
12 N SCREEN,TEMP,NRD,FIRST,SUB2
13 S BACK="",NUM=0,SCREEN=""
14 D LOC
15 I $D(DIC("S")) S SCREEN=DIC("S")
16 ;
17 S START="001.0 "
18START ;--RECYCLE POINT
19 S TITLE="ALL DIAGNOSES (ICD9 CODES)"
20 D SETUP
21 D LIST^DIC(FILE,"",FIELD,BACK,10,.START,"","BA",SCREEN,"","^TMP(""PXBTANA"",$J)","^TMP(""PXBTANA"",$J)")
22 D LOC,HEAD,SUB
23 ;
24PROMPT ;---WRITE PROMPT HERE
25 D WIN17^PXBCC(PXBCNT),LOC^PXBCC(15,1)
26 W !!,"Enter '^' to quit, '-' for previous page."
27 S DIR("A")="Select a single 'ITEM NUMBER' or 'RETURN' to continue: "
28 S DIR("?")="Enter ITEM 'No' to select , '^' to quit, '-' for previous page."
29 S DIR(0)="N,A,O^0:10:0^I X'?.1""-"".1""^"".2N!(+X>10) K X"
30 D ^DIR
31 I X="-" S BACK="B" D BACK G START
32 I X="" S BACK="" D FORWARD G START
33 I $G(DIRUT) K DIRUT S VAL="^P" G EXIT
34 ;
35FINISH ;--FINISH SETTING A VARIBLE TO SELECTED ITEM
36 S VAL=$G(^TMP("PXBTANA",$J,"DILIST",2,X))_"^"_$G(^TMP("PXBTANA",$J,"DILIST","ID",X,FIRST))_"--"_$G(^TMP("PXBTANA",$J,"DILIST","ID",X,SECOND))
37EXIT ;--EXIT
38 K DIR,^TMP("PXBTANA",$J),^TMP("PXBTOTAL",$J)
39 Q VAL
40 ;
41DOUBLE1(FROM) ;--Entry point
42NEW ;
43 N FILE,FIELD,TITLE,HEADING,SUB,CODE,NAME,START,SCREEN,CNT,OK,INDEX,CYCLE
44 N TOTAL,HLP,FIRST,SUB2
45 S BACK="",INDEX="BA"
46 S START=DATA,SUB=0,SUB2=0
47 ;
48START1 ;--RECYCLE POINT
49 W !
50 S TITLE="- - S E L E C T E D D I A G N O S E S (ICD9 CODES) - -"
51 S FILE=80
52 S FIELD=".01"
53 I DATA?1N S START=DATA*100 S START=$O(^ICD9("BA",START_" ",-1)) S INDEX="BA"
54 I DATA?2N S START=DATA*10 S START=$O(^ICD9("BA",START_" ",-1)) S INDEX="BA"
55 I DATA?3.NP S (START)=DATA-(.99) S START=$O(^ICD9("BA",START_" ",-1)) S INDEX="BA"
56 I DATA?1A.NP S START=$O(^ICD9("BA",START_" ",-1)) S INDEX="BA"
57 I DATA?2AP S HLP=1
58 I DATA?3.AP S START=$O(^ICD9("D",DATA),-1),INDEX="D"
59 I DATA?1A!(DATA?1.2N) D WAIT^DICD
60 ;
61 D LIST^DIC(FILE,"",FIELD,BACK,"",.START,DATA,INDEX,DIC("S"),"","^TMP(""PXBTOTAL"",$J)","^TMP(""PXBTOTAL"",$J)")
62 ;
63FILTER ;--FILTER OUT DUPLICATES
64 N I,DXINF S I=0 F S I=$O(^TMP("PXBTOTAL",$J,"DILIST","ID",I)) Q:I="" D
65 .S DXINF=$$DXNARR^PXUTL1(^TMP("PXBTOTAL",$J,"DILIST","ID",I,.01),$G(IDATE))
66 .I DXINF'="" S ^TMP("PXBOTAL",$J,$G(^TMP("PXBTOTAL",$J,"DILIST","ID",I,.01)),$E(DXINF,1,59)_" ",$G(^TMP("PXBTOTAL",$J,"DILIST",2,I))_" ")=""
67 K ^TMP("PXBTOTAL",$J)
68 N I,J,K,C S (I,J,K,C)="" F S I=$O(^TMP("PXBOTAL",$J,I)) Q:I="" D
69 .S C=C+1
70 .S J=$O(^TMP("PXBOTAL",$J,I,0))
71 .S K=$O(^TMP("PXBOTAL",$J,I,J,0))
72 .S ^TMP("PXBTOTAL",$J,"DILIST","ID",C,.01)=I
73 .S ^TMP("PXBTOTAL",$J,"DILIST","ID",C,10)=J
74 .S ^TMP("PXBTOTAL",$J,"DILIST",2,C)=K
75 S ^TMP("PXBTOTAL",$J,"DILIST",0)=C
76 K ^TMP("PXBOTAL",$J)
77 ;
78 S TOTAL=$P($G(^TMP("PXBTOTAL",$J,"DILIST",0)),"^",1)
79 ;
80 ;--DISPLAY IF NO MATCH FOUND
81 I TOTAL<1 D
82 .W IOEDEOP
83 .I '$G(HLP) W ! D HELP^PXBUTL0("CPTM")
84 .I $G(HLP) S RESULTS="USE AT LEAST THE 3 CHARACETERS" W !,IOCUU,?(IOM-$L(RESULTS))\2,RESULTS
85 .S ERROR=1,CYCL=1
86 I TOTAL<1 Q TOTAL
87 ;
88 ;----DISPLAY LIST TO THE SCREEN
89 S HEADING="W !,""ITEM"",?6,""CODE"",?15,""DESCRIPTION "",IOINHI,TOTAL,"" MATCHES"",IOINLOW"
90LIST ;-DISPLAY LIST TO THE SCREEN
91 I TOTAL=1 S X=1 G VAL
92 D LOC W !
93 X HEADING
94 S SUB=SUB-1
95 S NUM=0 F S SUB=$O(^TMP("PXBTOTAL",$J,"DILIST","ID",SUB)) S NUM=NUM+1 Q:NUM=11 Q:SUB'>0 S SUB2=SUB2+1 D
96 .S CODE=$G(^TMP("PXBTOTAL",$J,"DILIST","ID",SUB,.01))
97 .S NAME=$E($G(^TMP("PXBTOTAL",$J,"DILIST","ID",SUB,10)),1,64)
98 .W !,SUB,?6,CODE,?15,NAME
99 ;
100 ;----If There is only one selection go to proper prompting
101 I TOTAL=1 G PRMPT2
102 ;
103PRMPT ;---WRITE PROMPT HERE
104 D WIN17^PXBCC(PXBCNT)
105 D LOC^PXBCC(15,1)
106 W !
107 I SUB>0 W !,"Enter '^' to quit"
108 E I TOTAL>10 W !," END OF LIST"
109 I SUB>0 S DIR("A")="Select a single 'ITEM NUMBER' or 'RETURN' to continue: "
110 E S DIR("A")="Select a single 'ITEM NUMBER' or 'RETURN' to exit: "
111 S DIR("?")="Enter ITEM 'No' to select , '^' to quit"
112 S DIR(0)="N,A,O^0:"_SUB2_":0^I X'?.1""^"".N K X"
113 D ^DIR
114 I X="",SUB>0 G LIST
115 I X="",SUB'>0 S X="^"
116VAL ;-----Set the VAL equal to the value
117 S VAL=$G(^TMP("PXBTOTAL",$J,"DILIST",2,X))_"^"_$G(^TMP("PXBTOTAL",$J,"DILIST","ID",X,.01))
118EXITNEW ;--EXIT
119 K DIR,^TMP("PXBTANA",$J),^TMP("PXBTOTAL",$J)
120 K TANA,TOTAL
121 Q VAL
122 Q
123 ;
124 ;---SUBROUTINES
125BACK ;
126 S START=$G(^TMP("PXBTANA",$J,"DILIST",1,1))
127 S START("IEN")=$G(^TMP("PXBTANA",$J,"DILIST",2,1))
128 Q
129FORWARD ;
130 S START=$G(^TMP("PXBTANA",$J,"DILIST",1,10))
131 S START("IEN")=$G(^TMP("PXBTANA",$J,"DILIST",2,10))
132 Q
133LOC ;--LOCATE CURSOR
134 D LOC^PXBCC(3,1) ;--LOCATE THE CURSOR
135 W IOEDEOP ;--CLEAR THE PAGE
136 Q
137HEAD ;--HEAD
138 W !,IOCUU,IOBON,"HELP SCREEN",IOSGR0,?(IOM-$L(TITLE))\2,IOINHI,TITLE,IOINLOW,IOELEOL
139 Q
140SUB ;--DISPLAY LIST TO THE SCREEN
141 I $P(^TMP("PXBTANA",$J,"DILIST",0),"^",1)=0 W !!," E N D O F L I S T" Q
142 X HEADING
143 S SUB=0,CNT=0 F S SUB=$O(^TMP("PXBTANA",$J,"DILIST","ID",SUB)) Q:SUB'>0 S CNT=CNT+1 D
144 .S CODE=$G(^TMP("PXBTANA",$J,"DILIST","ID",SUB,FIRST))
145 .S NAME=$E($G(^TMP("PXBTANA",$J,"DILIST","ID",SUB,SECOND)),1,64)
146 .W !,SUB,?6,CODE,?15,NAME
147 Q
148SETUP ;-SETP VARIABLES
149 S FILE=80,FIRST=.01,SECOND=10
150 S FIELD=FIRST_";"_SECOND
151 S HEADING="W !,""ITEM"",?6,""CODE"",?15,""DESCRIPTION"""
152 Q
153PRMPT2 ;-----Yes and No prompt if onlyi choice
154 D WIN17^PXBCC(PXBCNT)
155 D LOC^PXBCC(15,1)
156 S DIR("A")="Is this the correct entry "
157 S DIR("B")="YES"
158 S DIR(0)="Y"
159 D ^DIR
160 I Y=0 S X="^"
161 I Y=1 S X=1
162 G VAL
Note: See TracBrowser for help on using the repository browser.