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

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

initial load of WorldVistAEHR

File size: 4.4 KB
Line 
1PXKVST ;ISL/ARS - SET UP VISIT FIELDS BEFORE CALLING OFF TO VSIT ;8/1/96
2 ;;1.0;PCE PATIENT CARE ENCOUNTER;**56,111,130,164**;Aug 12, 1996
3VSIT ;ENTRY POINT
4 ;COMMON SECTION
5 N PXKAFTR,PXKAFT8,PXKAFT15,PXKAFT21,PXKAF811,PXKAF812,PXVSTIEN
6 N VSIT,VSITPKG
7 S PXKAFTR=$S($G(^TMP("PXK",$J,"VST",1,0,"AFTER"))]"":^TMP("PXK",$J,"VST",1,0,"AFTER"),1:"")
8 Q:PXKAFTR=""
9 S PXKAFT21=$S($G(^TMP("PXK",$J,"VST",1,21,"AFTER"))]"":^TMP("PXK",$J,"VST",1,21,"AFTER"),1:"")
10 S PXKAFT15=$S($G(^TMP("PXK",$J,"VST",1,150,"AFTER"))]"":^TMP("PXK",$J,"VST",1,150,"AFTER"),1:"")
11 S PXKAFT8=$S($G(^TMP("PXK",$J,"VST",1,800,"AFTER"))]"":^TMP("PXK",$J,"VST",1,800,"AFTER"),1:"")
12 S PXKAF811=$S($G(^TMP("PXK",$J,"VST",1,811,"AFTER"))]"":^TMP("PXK",$J,"VST",1,811,"AFTER"),1:"")
13 S PXKAF812=$S($G(^TMP("PXK",$J,"VST",1,812,"AFTER"))]"":^TMP("PXK",$J,"VST",1,812,"AFTER"),1:"")
14 S VSIT("IEN")=$S(^TMP("PXK",$J,"VST",1,"IEN")]"":^TMP("PXK",$J,"VST",1,"IEN"),1:"")
15 I VSIT("IEN")="" S PXKAFTR=$TR(PXKAFTR,"@"),PXKAFT8=$TR(PXKAFT8,"@")
16 S VSIT("VDT")=$S($P(PXKAFTR,"^",1)]"":$P(PXKAFTR,"^",1),1:"NOW")
17 S VSIT("TYP")=$P(PXKAFTR,"^",3)
18 S VSIT("INS")=$P(PXKAFTR,"^",6)
19 S VSIT("OUT")=$P(PXKAFT21,"^")
20 S VSIT("PAT")=$P(PXKAFTR,"^",5)
21 S VSIT("SVC")=$P(PXKAFTR,"^",7)
22 S VSIT("DSS")=$P(PXKAFTR,"^",8)
23 S VSIT("LNK")=$P(PXKAFTR,"^",12)
24 S VSIT("WIA")=$P(PXKAFTR,"^",16)
25 S VSIT("LOS")=$P(PXKAFTR,"^",17)
26 S VSIT("COD")=$P(PXKAFTR,"^",18)
27 S:$P(PXKAFTR,"^",21)]"" VSIT("ELG")=$P(PXKAFTR,"^",21)
28 S VSIT("LOC")=$P(PXKAFTR,"^",22)
29 S VSIT("ACT")=$P(PXKAFTR,"^",26) ;PX*1.0*164
30 S:$P(PXKAFT8,"^",1)]"" VSIT("SC")=$P(PXKAFT8,"^",1)
31 S:$P(PXKAFT8,"^",2)]"" VSIT("AO")=$P(PXKAFT8,"^",2)
32 S:$P(PXKAFT8,"^",3)]"" VSIT("IR")=$P(PXKAFT8,"^",3)
33 S:$P(PXKAFT8,"^",4)]"" VSIT("EC")=$P(PXKAFT8,"^",4)
34 S:$P(PXKAFT8,"^",5)]"" VSIT("MST")=$P(PXKAFT8,"^",5) ;added 6/17/98 for MST enhancement
35 ;PX*1*111 - added for HNC enhancement
36 S:$P(PXKAFT8,"^",6)]"" VSIT("HNC")=$P(PXKAFT8,"^",6)
37 S:$P(PXKAFT8,"^",7)]"" VSIT("CV")=$P(PXKAFT8,"^",7)
38 S:$P(PXKAFT15,"^",1)]"" VSIT("SVP")=$P(PXKAFT15,"^",1)
39 S:$P(PXKAFT15,"^",2)]"" VSIT("IO")=$P(PXKAFT15,"^",2)
40 S:$P(PXKAFT15,"^",3)]"" VSIT("PRI")=$P(PXKAFT15,"^",3)
41 S:$P(PXKAF812,"^",2)]"" VSIT("PKG")=$P(PXKAF812,"^",2)
42 S:$P(PXKAF812,"^",3)]"" VSIT("SOR")=$P(PXKAF812,"^",3)
43 S:PXKAF811]"" VSIT("COM")=PXKAF811
44 I $G(VSIT("PRI"))="",VSIT("SVC")="E"!($P($G(^SC(+VSIT("LOC"),0)),"^",7)=VSIT("DSS")) S VSIT("PRI")="P"
45 S VSITPKG="PX"
46 I '$D(VSIT(0)) D
47 .S VSIT(0)=$S(VSIT("SVC")="E":"D0NM",1:"D0NEM")
48 ;
49 ;CALL FOR VSIT
50 D ^VSIT
51 I '$D(VSIT("IEN"))#2 Q
52 S PXVSTIEN=$P(VSIT("IEN"),"^",1)
53 S ^TMP("PXK",$J,"VST",1,"IEN")=PXVSTIEN
54 I PXVSTIEN<1 Q
55 D VIEN(PXVSTIEN)
56 I $P(VSIT("IEN"),"^",3)'=1 D
57 .S ^TMP("PXK",$J,"VST",1,0,"BEFORE")=^AUPNVSIT(PXVSTIEN,0)
58 .S ^TMP("PXK",$J,"VST",1,21,"BEFORE")=$G(^AUPNVSIT(PXVSTIEN,21))
59 .S ^TMP("PXK",$J,"VST",1,150,"BEFORE")=$G(^AUPNVSIT(PXVSTIEN,150))
60 .S ^TMP("PXK",$J,"VST",1,800,"BEFORE")=$G(^AUPNVSIT(PXVSTIEN,800))
61 .S ^TMP("PXK",$J,"VST",1,811,"BEFORE")=$G(^AUPNVSIT(PXVSTIEN,811))
62 .S ^TMP("PXK",$J,"VST",1,812,"BEFORE")=$G(^AUPNVSIT(PXVSTIEN,812))
63 .S $P(^TMP("PXK",$J,"VST",1,0,"AFTER"),"^",3)=$P(^AUPNVSIT(PXVSTIEN,0),"^",3)
64 .S $P(^TMP("PXK",$J,"VST",1,0,"AFTER"),"^",7)=$P(^AUPNVSIT(PXVSTIEN,0),"^",7)
65 I $P(VSIT("IEN"),"^",3)=1 D
66 .S ^TMP("PXK",$J,"VST",1,0,"AFTER")=^AUPNVSIT(PXVSTIEN,0)
67 .S ^TMP("PXK",$J,"VST",1,21,"AFTER")=$G(^AUPNVSIT(PXVSTIEN,21))
68 .S ^TMP("PXK",$J,"VST",1,150,"AFTER")=$G(^AUPNVSIT(PXVSTIEN,150))
69 .S ^TMP("PXK",$J,"VST",1,800,"AFTER")=$G(^AUPNVSIT(PXVSTIEN,800))
70 .S ^TMP("PXK",$J,"VST",1,811,"AFTER")=$G(^AUPNVSIT(PXVSTIEN,811))
71 .S ^TMP("PXK",$J,"VST",1,812,"AFTER")=$G(^AUPNVSIT(PXVSTIEN,812))
72 .S ^TMP("PXK",$J,"VST",1,0,"BEFORE")=""
73 .S ^TMP("PXK",$J,"VST",1,21,"BEFORE")=""
74 .S ^TMP("PXK",$J,"VST",1,150,"BEFORE")=""
75 .S ^TMP("PXK",$J,"VST",1,800,"BEFORE")=""
76 .S ^TMP("PXK",$J,"VST",1,811,"BEFORE")=""
77 .S ^TMP("PXK",$J,"VST",1,812,"BEFORE")=""
78 .I $D(PXELAP)#2 D
79 ..S ^TMP("PXKCO",$J,PXVSTIEN,"VST",PXVSTIEN,"ELAP","BEFORE")=""
80 ..S ^TMP("PXKCO",$J,PXVSTIEN,"VST",PXVSTIEN,"ELAP","AFTER")=PXELAP
81 K VSIT
82 Q
83 ;
84VIEN(VIEN) ;Put the Visit IEN in the AFTERs for all of the V-Files
85 N PXCAINX1,PXCAINX2
86 S PXCAINX1=""
87 F S PXCAINX1=$O(^TMP("PXK",$J,PXCAINX1)) Q:PXCAINX1']"" D:"^VST^SOR^"'[PXCAINX1
88 . S PXCAINX2=""
89 . F S PXCAINX2=$O(^TMP("PXK",$J,PXCAINX1,PXCAINX2)) Q:PXCAINX2']"" D
90 .. I $D(^TMP("PXK",$J,PXCAINX1,PXCAINX2,0,"AFTER"))=1 S $P(^TMP("PXK",$J,PXCAINX1,PXCAINX2,0,"AFTER"),"^",3)=VIEN
91 Q
92 ;
Note: See TracBrowser for help on using the repository browser.