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

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

initial load of WorldVistAEHR

File size: 3.6 KB
Line 
1DGPTFTR2 ;ALB/JDS - ALB/BOK PTF TRANSMISSION ; 01 DEC 87 @0800
2 ;;5.3;Registration;**729**;Aug 13, 1993;Build 59
3501 ;
4 K DGCMVT I T2'=9999999 S DGCMVT=$O(^DGPT(J,"M","AM",+$P(T2,".")_".2359")),DGCMVT=$S('DGCMVT:1,$O(^(DGCMVT,0)):$O(^(0)),1:1)
5 F I=0:0 S I=$O(^DGPT(J,"M",I)) G PROC:I'>0 I $D(^(I,0)) S DGM=^(0),DGTD=$P(DGM,U,10) S:$D(DGCMVT) DGTD=$S(I=DGCMVT:$P(T2,".")_".2359",1:DGTD) I $P(DGM,U,17)'="n",DGTD,DGTD'<T1,DGTD'>T2 D MOV
6MOV S DGM=$P(DGM,U,1,9)_U_$P(DGM,U,11,15),L=1
7 F Z=5:1:14 S:'$P(DGM,U,Z) DGM=$P(DGM,U,1,Z-1)_U_$P(DGM,U,Z+1,99) S:'$P(DGM,U,Z) Z=Z-1 S L=L+1 Q:L=10
8 S Y=$S(T1:"C",1:"N")_"501"_DGHEAD,X=$P(DGTD,".")_" ",Y=Y_$E(X,4,5)_$E(X,6,7)_$E(X,2,3)
9 N DGSARRX,DGSARRY
10 S DGARRX=$$TSDATA^DGACT(42.4,$P(DGM,U,2),.DGARRY)
11 S $P(DGM,U,2)=$G(DGARRY(7))
12 S L=2,X=DGM,Z=2 D ENTER0 S Y=Y_" "
13 S L=3 F Z=3,4 D ENTER0
14 S L=1,X=DG57,Z=4 D ENTER S:I=1 DG502=Y
15 F Z=5:1:9 S F=$S($D(^ICD9(+$P(DGM,U,Z),0)):$P(^(0),U,1),1:" ."),F=$P(F,".",1)_$E($P(F,".",2)_" ",1,3),F=F_$E(" ",1,7-$L(F)),Y=Y_F
16 ; bed occupant
17 I T1 S Y=Y_$S(I=1:$E($P(DG70,U,14)_" "),$P(+DGTD,".")=$P(T2,"."):5,1:1)
18 I 'T1 S Y=Y_$S(I=1:$E($P(DG70,U,14)_" "),1:" ")
19 D SAVE
20 Q
21 ;
22PROC K DGCMVT,^UTILITY($J,"PROC") S I=0
23601 S I=$O(^DGPT(J,"P",I)) G 701:I'>0 S (X,DGPROC)=^(I,0) G 601:'DGPROC
24 G 601:DGPROC<T1!(DGPROC>T2) S DGPROCD=+^DGPT(J,"P",I,0)\1,^UTILITY($J,"PROC",DGPROCD)=$S($D(^UTILITY($J,"PROC",DGPROCD)):^(DGPROCD),1:0)+1
25 I ^UTILITY($J,"PROC",DGPROCD)>1 W !,"More than one procedure record on same date" S DGERR=1 Q
26 S Y=$S('T1:"N",1:"C")_"60"_^(DGPROCD)_DGHEAD_$E(DGPROCD,4,7)_$E(DGPROCD,2,3)
27 N DGARRY,DGARRX ;DG729
28 S DGARRX=$$TSDATA^DGACT(42.4,$P(X,U,2),.DGARRY)
29 S $P(X,U,2)=$G(DGARRY(7))
30 S L=2,Z=2 D ENTER0 S L=1,Z=3 D ENTER S L=3,Z=4 D ENTER0
31 S L=1 F K=5:1:9 S:'$P(DGPROC,U,K) DGPROC=$P(DGPROC,U,1,K-1)_U_$P(DGPROC,U,K+1,99),K=K-1 S L=L+1 Q:L=5
32 F K=5:1:9 S Y=Y_$S($D(^ICD0(+$P(DGPROC,U,K),0)):$J($P($P(^(0),U,1),".",1),2)_$E($P($P(^(0),U,1),".",2)_" ",1,3),1:" ")_" "
33 S Y=Y_" " D SAVE G 601
34 Q
35 ;
36701 S Y=$S(T1:"C",1:"N")_"701"_DGHEAD,DGDDX=+DG70\1_" ",Y=Y_$E(DGDDX,4,5)_$E(DGDDX,6,7)_$E(DGDDX,2,3)
37 S X=DG70
38 N DGARRX,DGARRY ;DG729
39 S DGARRX=$$TSDATA^DGACT(42.4,$P(X,U,2),.DGARRY)
40 S $P(X,U,2)=$G(DGARRY(7))
41 S (L,Z)=2 D ENTER0 S Y=Y_" " K DGDDX
42 S X=DG70 I "467"[($P(X,U,3)\1) S Y=Y_$P(X,U,3)_" " G J
43 S L=1 F Z=3:1:5 D ENTER
44 S Y=Y_$S($D(^DIC(45.6,+$P(X,U,6),0)):$P(^(0),U,2),1:" "),L=3,Z=12 D ENTER S Y=Y_$E($P(X,U,13)_" ",1,3)
45J S L=3,Z=8 D ENTER0
46 S Y=Y_$S($D(^DIC(10,+$P(DG10,U,6),0)):$J($P(^(0),U,2),1),1:" ")_$J($P(DG70,U,9),1)
47 S DGXLS=$S($D(^ICD9(+$P(DG70,U,10),0)):$P(^(0),U,1),1:""),Y=Y_$S(DGXLS[".":$J($P(DGXLS,".",1),3)_$E($P(DGXLS,".",2)_" ",1,3),1:$J(DGXLS,6))_" "
48 S L=$P(DG70,U,16,24) S DG702="" F K=1:1:9 I $D(^ICD9(+$P(L,U,K),0)) S DG702=DG702_$P(^(0),U,1)_U
49 I DG702']"" S Y=Y_"X"
50 D Y
51 I T1 F K=34:1:47,60 S Y=$E(Y,1,K-1)_" "_$E(Y,K+1,80)
52 I T1 D CEN^DGPTFTR1 S:'DGERR ^UTILITY($J,DGCNT,0)=Y,DGCNT=DGCNT+1 Q
53 I 'T1 D SAVE
54702 ;
55 Q:DG702']""
56 S Y="N702"_$E(Y,5,33)
57 F K=1:1:5 S F=$P(DG702,U,K),F=$P(F,".",1)_$E($P(F,".",2)_" ",1,3),F=F_$E(" ",1,7-$L(F)),Y=Y_F
58 D Y
59 I 'DGERR S ^UTILITY($J,DGCNT,0)=Y,DGCNT=DGCNT+1
60 S DG702=$P(DG702,U,6,9)
61 ;
62703 Q:DG702']""
63 S Y="N703"_$E(Y,5,33)
64 F K=1:1:4 S F=$P(DG702,U,K),F=$P(F,".",1)_$E($P(F,".",2)_" ",1,3),F=F_$E(" ",1,7-$L(F)),Y=Y_F
65 D Y
66 I 'DGERR S ^UTILITY($J,DGCNT,0)=Y,DGCNT=DGCNT+1
67 Q
68 ;
69ENTER S Y=Y_$J($P(X,U,Z),L)
70 Q
71 ;
72ENTER0 S Y=Y_$S($P(X,U,Z)]"":$E("00000",$L($P(X,U,Z))+1,L)_$P(X,U,Z),1:$J($P(X,U,Z),L))
73 Q
74 ;
75SAVE D START^DGPTFTR1 S:'DGERR ^UTILITY($J,DGCNT,0)=Y,DGCNT=DGCNT+1
76Q Q
77 ;
78Y F K=$L(Y):1:79 S Y=Y_" "
Note: See TracBrowser for help on using the repository browser.