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

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

initial load of FOIAVistA 6/30/08 version

File size: 3.8 KB
Line 
1DG1010PA ;ALB/REW - 1010 PRINT--INQUIRY PATIENT -ADDITIONL ; 28-MAY-93
2 ;;5.3;Registration;**18,28,86,108,113,570,624**;Aug 13, 1993
3 ;
4NOREG(DFN) ; DOES PROMPTS FOR 10/10 PRINT W/O REGISTRATION
5 ;INPUT: DFN
6 ;OUTPUT: VARIABLES NEEDED FOR DIFFERENT PRINTOUTS
7 ; DGMTYPT - MT=1 Copay=2 None=0
8 ; DGOPT - WHICH REPORTS TO PRINT
9 ; DGPMDA - Admissions Report Info
10 ; PRF - FLAG FOR RX PROFILE
11 ; PSOINST - STATION NUMBER (INSTITUTION FILE) FOR ACTION PROFILE PRINT
12 ; PSONOPG - USED FOR PRINTING ACTION PROFILE (SET TO 1)
13 ; PSOPAR - PRINT BARCODES FOR ACTION PROFILE (SET TO 1)
14 ; PSTYPE - TYPE OF DRUG PROFILE
15 ; GMTSTYP - TYPE OF HEALTH SUMMARY
16 ; EASMTIEN - Means Test IEN used for EZ/EZR
17 ;
18 ;
19 N DG1,I,X,Y,FORM
20 S FREE=+$P(^DG(43,1,0),U,8),DGOPT=""
21 S PRF=0 G QTNOREG:'$D(^DG(43,1,0)) ;NEED MAS PARAMETERS TO CONTINUE
22 I $$PROMPRN("THIRD") G:DG1<0 QTNOREG S DGOPT=DGOPT_3
23 S FORM=$$SEL1010^DG1010P()
24 S EASMTIEN=$$MTPRMPT^DG1010P(DFN,$G(DGMTI))
25 I FORM<0 S DG1=-1 G QTNOREG
26 I FORM="EZ" S DGOPT=DGOPT_0
27 I FORM="EZR" S DGOPT=DGOPT_1
28 I $$PROMPRN("HS") G:DG1<0 QTNOREG S DGOPT=DGOPT_8
29 I $$PROMPRN("PRO") G:DG1<0 QTNOREG S DGOPT=DGOPT_5,PRF=1
30QTNOREG S:$G(DG1)<0 DGOPT=""
31 Q
32PROMPRN(DGX) ; PROMPTS FOR PRINT
33 ; RETURNS DGX [1=YES;0=NO;-1=DIRUT CONDITIONS]
34 ; OUTPUT:DG1 VALUE
35 S DG1=0
36 I $$FAILCOND(DGX) S DG1=$S($D(DG1):DG1,1:2) G QTPROMP ;DEFAULT=NO
37 F D Q:$G(DG1)
38 .S DG1=$$ASK(DGX)
39 .S:DG1=1 DG1=$$AFTERASK(DGX)
40QTPROMP Q $S(DG1=2:0,(DG1=1):1,1:DG1)
41ASK(DGX) ; PROMPTS FOR PRINT
42 ;
43 ; RETURNS DGX [2=NO,1=YES;0=?,-1=DIRUT CONDITIONS]
44 W !,"PRINT "
45 W $S(DGX="THIRD":"ERROR",(DGX="HS"):"HEALTH SUMMARY",(DGX="PRO"):"DRUG PROFILE",(DGX="EF"):"ENCOUNTER FORMS",1:"ERROR")
46 S %=1 D YN^DICN I '% W !,"ENTER 'Y'ES TO PRINT A ",DGX,". OTHERWISE ENTER 'N'O."
47 Q $G(%)
48FAILCOND(DGX) ;CHECKS IF PROMPT SHOULD BE ASKED
49 ;
50 ; DGI: 2=NO;1=YES;-1=DIRUT
51 ;RETURNS 1=DON'T ASK AND SKIP TO NEXT;0=ASK
52 ;
53 N DGFAIL
54 S DGFAIL=0
55 I DGX=1010 G QTFAIL
56 I DGX="THIRD" F D Q:$G(%) G QTFAIL
57 .N DGNOQ,DGDEF
58 .D ADM
59 .S DGFAIL=1
60 .I DGPMDA>0!$D(^DGS(41.1,"B",DFN)) D
61 ..S (DGNOQ,DGDEF)=1 D ASK^DGBLRV
62 ..S DG1=%
63 I DGX="HS" S DGFAIL=1 D G QTFAIL
64 .S X="GMTSDVR" X ^%ZOSF("TEST") I $T D
65 ..S:$T(ENXQ^GMTSDVR)]""&($P(^DG(43,1,0),U,42)) DGFAIL=0
66 I DGX="PRO" S DGFAIL=1 D G QTFAIL
67 .S X="PSOSD1" X ^%ZOSF("TEST") I '$T Q
68 .I '$P(^DG(43,1,0),U,17) Q
69 .S DGFAIL=0
70 I DGX="EF" D G QTFAIL
71 .I $P(^DG(43,1,0),U,47)'=1 S DGFAIL=1 Q
72QTFAIL Q DGFAIL
73AFTERASK(DGX) ;ACTIONS AFTER REPONSE OF YES TO PRINT
74 ;NOTE: Reports removed from DG REGISTRATION 10/10 REPRINT option are
75 ; remaining to support any outside integrations.
76 ;
77 ; RETURNS DGGO[2=DON'T PRINT,1=PRINT,-1=ABORT]
78 ; SETS PRINT-SETUP VARIABLES
79 ; PSOINST - STATION NUMBER (INSTITUTION FILE) FOR ACTION PROFILE PRINT
80 ; PSONOPG - USED FOR PRINTING ACTION PROFILE (SET TO 1)
81 ; PSOPAR - PRINT BARCODES FOR ACTION PROFILE (SET TO 1)
82 ; PSTYPE = DRUG PROFILE TYPE
83 ; GMTSTYP = POINTER TO HEALTH SUMMARY TYPE
84 ;
85 N DGGO,DIR,X,Y
86 S DGGO=1
87 I DGX="HS" D ;HEALTH SUMMARY
88 .S X=$P($G(^DG(43,1,0)),U,43),DIC=142,DIC(0)="NX"
89 .D ^DIC K DIC
90 .S:+Y DIR("B")=$P(Y,U,2)
91 .S DIR(0)="PO^142:QAMEZ"
92 .D ^DIR
93 .I Y'>0 W !,*7,"No Type Selected. HS will not print" S DGGO=2 K DIR,DIRUT,DUOUT Q
94 .S GMTSTYP=+Y
95 I DGX="PRO" D ;DRUG PROFILE
96 .S DGGO=0
97 .N DGDEF
98 .S DGDEF=$P(^DG(43,1,0),U,45)
99 .I $P(^DG(43,1,0),U,44) D
100 ..S:DGDEF]"" DIR("B")=$S(DGDEF="A":"ACTION",(DGDEF="I"):"INFORMATIONAL",1:"")
101 ..S DIR(0)="SM^A:ACTION;I:INFORMATIONAL"
102 ..S DIR("A")="Select type of Drug Profile"
103 ..D ^DIR
104 ..S DGDEF=Y
105 .I '$D(DIRUT) D
106 ..S (PSOPAR,PSTYPE)=$S(DGDEF="A":1,(DGDEF="I"):0,1:0),(DGGO,PSONOPG)=1
107 ..S PSOINST=+$P($G(^DIC(4,+$P($G(^XMB(1,1,"XUS")),U,17),99)),U)
108 Q DGGO
109ADM K DGPMDA I $D(^DGPM("ATID1",DFN)) F I=0:0 S I=$O(^DGPM("ATID1",DFN,I)) Q:'I!(I>(DFN1+.9999)) S DGPMDA=$O(^(I,0))
110 S DGPMDA=$S($D(DGPMDA):DGPMDA,1:0)
111 Q
Note: See TracBrowser for help on using the repository browser.