source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPMVBUR.m@ 1351

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1DGPMVBUR ;ALB/MIR - UR ADMISSION BULLETIN FOR MCCR ; 9/16/03 2:24pm
2 ;;5.3;Registration;**26,31,483,549,570**;AUG 13, 1993
3 ;
4UR ;UR bulletin
5 K DGPMUR
6 D INS I '$D(DGPMUR(10)) D URQ Q
7 S DGPMX=$O(^XMB(3.8,"B","DGPM UR ADMISSION",0)) I '$O(^XMB(3.8,+DGPMX,1,0)) K DGPMX D URQ Q ; if no mailgroup members, quit
8 S XMSUB="UR ADMISSION BULLETIN",XMTEXT="DGPMUR(",DGPMBLN=0
9 S XMY("G.DGPM UR ADMISSION")="" ; pass mailgroup
10 D PID^VADPT6 S DGPMBL="Admission for : "_$P(^DPT(DFN,0),"^",1)_" "_VA("PID") D SETLN
11 S Y=+DGPMA X ^DD("DD") S DGPMBL="Date/Time : "_Y D SETLN
12 S DGPMBL="Type of Admit : "_$S($D(^DG(405.1,+$P(DGPMA,"^",4),0)):$P(^(0),"^",1),1:"") D SETLN
13 S DGPMBL=" " D SETLN
14 S DGPMBL="Ward Location : "_$S($D(^DIC(42,+$P(DGPMA,"^",6),0)):$P(^(0),"^",1),1:"UNKNOWN") D SETLN
15 S DGPMBL="Room-Bed : "_$S($D(^DG(405.4,+$P(DGPMA,"^",7),0)):$P(^(0),"^",1),1:"UNKNOWN") D SETLN
16 S DGPMBL="Admitting DX : "_$P(DGPMA,"^",10) D SETLN
17 S DGPMBL=" " D SETLN
18 S DGPMBLN=DGPMLAST D V72HR ; visits in last 72 hours
19 D DIS ;SC disabilities
20 D ^XMD
21URQ K DGPMBL,DGPMBLN,DGPMLAST,DGPMUR,DGTMP,XMY,XMSUB,XMTEXT
22 K %,%Y,DGPMOB,DGPMOW,DGPMX,I,X,X1,X2,Y,DGIBINS
23 Q
24 ;
25INS ;get insurance effective at time of admission, start at DGPMBLN=10
26 S DGPMBLN=9
27 K DGIBINS
28 N DGX,DGDATA,DGIB
29 ;
30 S DGIB=$$INSUR^IBBAPI(DFN,"","",.DGDATA,"*") ; Returns Active, Reimbursable Ins. only
31 S DGX="DGDATA(""IBBAPI"",""INSUR"")" M DGIBINS=@DGX
32 F I=0:0 S I=$O(DGIBINS(I)) Q:'I D ACT
33 ;
34 I $D(DGPMUR(10)) S DGPMLAST=DGPMBLN
35 Q
36 ;
37ACT ;is insurance active? If so, set in DGPMBLN array
38 I DGIBINS(I,11)<+DGPMA,DGIBINS(I,11)]"" Q ;insurance expired before admission
39 I DGIBINS(I,10)>+DGPMA Q ;insurance effective after admission
40 Q:'+DGIBINS(I,1)
41 ; get insurance company information
42 S DGPMBL="Insurance Co. : "_$P(DGIBINS(I,1),"^",2) D SETLN
43 S DGTMP=$P(DGIBINS(I,8),U,2)
44 I DGTMP']"" S DGTMP=$S($G(DGIBNS(I,18))]"":DGIBINS(I,18),1:"")
45 I DGTMP']"" S DGTMP=""
46 I DGTMP]"" S DGPMBL="Group : "_DGTMP D SETLN
47 S DGPMBL="Policy Holder : "_DGIBINS(I,13) D SETLN
48 S DGPMBL="Subscriber ID : "_DGIBINS(I,14) D SETLN
49 S DGPMBL="Ins. Co Phone# : "_$S(DGIBINS(I,6)]"":DGIBINS(I,6),1:"UNKNOWN") D SETLN
50 S DGPMBL=" " D SETLN
51 Q
52DIS ;rated disabilities
53 I $S('$D(^DPT(DFN,.3)):1,$P(^(.3),"^",1)'="Y":1,1:"") Q ;not service connected...
54 I $S('$D(^DPT(DFN,"VET")):1,$P(^("VET"),"^",1)'="Y":1,1:0),$S('$D(^DG(391,+$S($D(^DPT(DFN,"TYPE")):^("TYPE"),1:""),0)):1,$P(^(0),"^",2):0,1:1) Q
55 ;X=0 node, X1=already one SC disability?
56 S X1=0 F I=0:0 S I=$O(^DPT(DFN,.372,I)) Q:'I I $D(^(I,0)) S X=^(0) I $P(X,"^",3)&$D(^DIC(31,+X,0)) S DGPMBL=$S('X1:"SC Disabilities: ",1:" ")_$P(^(0),"^",1)_" ("_+$P(X,"^",2)_"%)" S X1=1 D SETLN
57 Q
58V72HR ; GET INFORMATION FROM VISITS FOR THE LAST 72 HOURS
59 NEW X,X1,X2,IDEN,ID,LOCN,HSPN
60 S X1=+DGPMA,X2=-3
61 D C^%DTC
62 S X=X-.0001
63GVTIME ; LOOP THROUGH "B" INDEX OF ^AUPNVSIT FILE
64 S X=$O(^AUPNVSIT("B",X))
65 I X="" Q
66 I X'<+DGPMA Q
67 S IDEN=""
68GVID ; CHECK FOR CORRECT PATIENT
69 S IDEN=$O(^AUPNVSIT("B",X,IDEN))
70 I IDEN="" G GVTIME
71 I +$P($G(^AUPNVSIT(IDEN,0)),"^",5)'=+DFN G GVID
72 S LOCN=$P(^AUPNVSIT(IDEN,0),"^",22)
73 ; DG/549
74 I $G(LOCN)>0 S HSPN=$P($G(^SC(LOCN,0)),"^",1)
75 E S HSPN="Unknown location" I $P($G(^AUPNVSIT(IDEN,0)),"^",7)="E" S HSPN=HSPN_"-Event(Historical)"
76 ;
77 S Y=+X X ^DD("DD")
78 S DGPMBL="Previous Visit : "_HSPN_" "_Y
79 D SETLN
80 G GVID
81 Q
82SETLN ;--set line in xmtext array
83 S DGPMBLN=DGPMBLN+1
84 S DGPMUR(DGPMBLN)=DGPMBL
85 Q
Note: See TracBrowser for help on using the repository browser.