source: WorldVistAEHR/trunk/r/REGISTRATION-DGQE-DG-DPT-GRPX-VAD-VAF-VAS-VAT-VAU--VA-VIC--DGBT--DGJ--DGYA--VALM/DGPTLMU4.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: 4.0 KB
Line 
1DGPTLMU4 ;ALB/MTC/ADL - PTF A/P LIST MANAGER UTILITY CONT. ; 9-24-92
2 ;;5.3;Registration;**510**;Aug 13, 1993
3 ;;ADL;;Update for CSV Project;;Mar 27, 2003
4 ;
5EN ;-- single PTF record entry point
6 ; INPUT - DGPTF record to display
7 K ^TMP("ARCPTFDI",$J)
8 D EN^VALM("DGPT DETAILED INQUIRY")
9 D CLEAR^VALM1
10 Q
11 ;
12DIEX ;-- exit code
13 K ^TMP("ARCPTFDI",$J),DGPTF
14 D CLEAR^VALM1
15 Q
16 ;
17DIHEAD ;-- header code
18 S VALMHDR(1)="Patient Name: "_$P(^DPT(+^DGPT(DGPTF,0),0),U)
19 S VALMHDR(2)="PTF record # :"_DGPTF
20 S VALMHDR(3)="Admission Date :"_$$FTIME^VALM1($P(^DGPT(DGPTF,0),U,2))
21 Q
22 ;
23DIEN ;-- list manager entry point
24 D SEL^DGPTLMU3
25 S DGPTF=+$O(VALMY(0))
26 I ('$D(^DGPT(DGPTF))!('$D(^TMP("ARCPTF",$J,"LIST","REC",DGPTF)))) S VALMBCK="" D G DIENQ
27 . W !,">>> Invalid selection"
28 D EN^VALM("DGPT DETAILED INQUIRY")
29 S VALMBCK="R"
30DIENQ Q
31 ;
32DIINT ;-- This function will load the array containing the
33 ; PTF detailed information.
34 ; INPUT : DGPTF - Valid PTF entry
35 ;
36 N I,J,X,Y,DGINC,X1,X2,NUMREC
37 S NUMREC=0,X1=""
38 S Y="Patient Name :"_$P(^DPT(+^DGPT(DGPTF,0),0),U)
39 S X1=$$SETSTR^VALM1(Y,X1,1,40)
40 S Y="PTF Record # :"_DGPTF
41 S X1=$$SETSTR^VALM1(Y,X1,45,30)
42 S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=X1,X1=""
43 S Y="Admin Date :"_$$FTIME^VALM1($P(^DGPT(DGPTF,0),U,2))
44 S X1=$$SETSTR^VALM1(Y,X1,1,40),DG70=$G(^DGPT(DGPTF,70))
45 S Y="Disch Date :"_$S(+DG70:$$FTIME^VALM1(+DG70),1:"<UNKNOWN>")
46 S X1=$$SETSTR^VALM1(Y,X1,45,30)
47 S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=X1,X1=""
48 S Y="Disch Specialty :"_$S($P(DG70,U,2):$P(^DIC(42.4,$P(DG70,U,2),0),U),1:"")
49 S X1=$$SETSTR^VALM1(Y,X1,1,40),X=$P(DG70,U,3)
50 S Y="Type of Dispos :"_$S(X:$P($P($P(^DD(45,72,0),U,3),";",X),":",2),1:"")
51 S X1=$$SETSTR^VALM1(Y,X1,45,30)
52 S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=X1,X1="",X=$P(DG70,U,14)
53 S Y="Disch Status :"_$S(X:$P($P($P(^DD(45,72.1,0),U,3),";",X),":",2),1:"")
54 S X1=$$SETSTR^VALM1(Y,X1,1,40),X=$P(DG70,U,4)
55 S Y="Outpatient Treatment :"_$S(X=1:"YES",1:"NO")
56 S X1=$$SETSTR^VALM1(Y,X1,45,30)
57 S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=X1,X1=""
58 S Y="ASIH Days :"_$S($P(DG70,U,8)]"":$P(DG70,U,8),1:"")
59 S X1=$$SETSTR^VALM1(Y,X1,1,40),X=$P(DG70,U,9)
60 S Y="C&P Status :"_$S(X:$P($P($P(^DD(45,78,0),U,3),";",X),":",2),1:"")
61 S X1=$$SETSTR^VALM1(Y,X1,45,30)
62 S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=X1,X1=""
63 S Y="VA Auspices :"_$S($P(DG70,U,5)=1:"YES",1:"NO")
64 S X1=$$SETSTR^VALM1(Y,X1,1,40)
65 S DGINC=$P($G(^DGPT(DGPTF,101)),U,7) I DGINC>1000 S DGINC=$E(DGINC,1,$L(DGINC)-3)_","_$E(DGINC,$L(DGINC)-2,$L(DGINC))
66 S Y="Income :"_$S(DGINC]"":"$"_DGINC,1:"")
67 S X1=$$SETSTR^VALM1(Y,X1,45,30)
68 S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=X1
69 ;-- check for ICD codes
70 S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)="ICD CODES :"
71 F J=10,15:1:24 I $P(DG70,U,J) D
72 . S DGPTTMP=$$ICDDX^ICDCODE(+$P(DG70,U,J),$$GETDATE^ICDGTDRG(DGPTF))
73 . S Y=$P(DGPTTMP,U,2)_" - "_$P(DGPTTMP,U,4)
74 . S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=" "_Y
75 ;
76 ;-- check for 300 node information
77 S X2=$G(^DGPT(DGPTF,300)) I X2]"" D DI300(X2)
78 ;
79 D DI501^DGPTLMU6,DI401^DGPTLMU5,DI601^DGPTLMU5,DI535^DGPTLMU6
80 F X=1:1:NUMREC S ^TMP("ARCPTFDI",$J,"IDX",X,X)=""
81 S VALMCNT=NUMREC
82 Q
83 ;
84DI300(X2) ;-- load 300 node information
85 ; INPUT X2 - Contains 300 node
86 ; OUTPUT - Load display array
87 ;
88 N X3,Y
89 I +$P(X2,U,2) S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)="Suicide Indicator :"_$S($P(X2,U,2)=1:"Attempted",1:"Accomplished")
90 I +$P(X2,U,3) S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)="Legionnaire's Disease :"_$S($P(X2,U,3)=1:"YES",1:"NO")
91 I +$P(X2,U,4) S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)="Abused Substance :"_$P($G(^DIC(45.61,$P(X2,U,4),0)),U)
92 I $P(X2,U,5)]"" D
93 . S Y="Psychiatry Classification Severity :",X3=$P(X2,U,5)
94 . S Y=Y_$S(X3]"":$P($P($P(^DD(45.02,300.05,0),U,3),";",X3),":",2),1:"")
95 . S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)=Y
96 I $P(X2,U,6)]"" S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)="Current Psychiatry Classification Assesment :"_$P(X2,U,6)
97 I $P(X2,U,7)]"" S ^TMP("ARCPTFDI",$J,$$NUM(.NUMREC),0)="Highest Level Psychiatry Classification :"_$P(X2,U,7)
98 Q
99 ;
100NUM(X) ;-- increment function
101 ; INPUT : X -number to increment
102 ;OUTPUT : X+1
103 S X=X+1
104 Q X
Note: See TracBrowser for help on using the repository browser.