source: FOIAVistA/trunk/r/PATIENT_REPRESENTATIVE-QAC/QACRPT.m@ 1614

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

initial load of FOIAVistA 6/30/08 version

File size: 4.6 KB
Line 
1QACRPT ;HISC/RS,CEW - Print report of contact ;1/17/95 13:06
2 ;;2.0;Patient Representative;**3,5,6,9**;07/25/1995
3 K DIC
4 N QACAUTH S QACAUTH=0
5 S DIC="^QA(745.1,",DIC(0)="AEMQZ",DIC("A")="Enter the Contact you wish to generate: "
6 ;see if user has QAC EDIT security key, or initially entered the ROC
7 I $D(^XUSEC("QAC EDIT",DUZ))#2 S QACAUTH=1
8 S DIC("S")="I $G(QACAUTH)!(DUZ=$P(^QA(745.1,+Y,0),U,7))"
9 D ^DIC K DIC Q:Y<0 S QAC=+Y
10 ;only holders of QAC EDIT security key may see Resolution Comments
11 I $G(QACAUTH)=1 K DIR S DIR(0)="Y",DIR("B")="NO",DIR("A")="Do you want the Resolution Text included " D ^DIR K DIR Q:$D(DIRUT) S QACRES=+Y D EN G QACRPT
12EN K %ZIS,IOP S %ZIS="MQ"
13 W ! D ^%ZIS G:POP QUIT
14 I $D(IO("Q")) D G QUIT
15 . K IO("Q")
16 . S ZTDESC="Report of Contact"
17 . S ZTRTN="START^QACRPT"
18 . S (ZTSAVE("QAC"),ZTSAVE("QACRES"))=""
19 . D ^%ZTLOAD
20START U IO
21START1 ;called from QACALRT1 for screen display of ROC for alert
22 S QACDA0=$G(^QA(745.1,QAC,0)),QACDA2=$G(^QA(745.1,QAC,2)),QACO=0
23 S QACSTR="1,2,3,12,0,10,0,7,8,0,9,6,0,0",QACQUIT=0
24 F J=1,2,3,12,8,9,6,4 S QACO($P(QACSTR,",",J))=$P(QACDA0,"^",J)
25 I QACO(3)'="" S QACO(4)=$P($G(^DPT(QACO(3),0)),"^",9),QACO(3)=$P($G(^DPT(QACO(3),0)),"^",1)
26 E S QACO(4)=""
27 S QACO(5)=$P(QACDA2,"^",2)
28 S X1=$P(QACDA2,"^",4),X2=+$P(QACDA2,"^",5) I X1 D C^%DTC I X S Y=X X ^DD("DD") S QACO(9)=Y
29 I $G(QACO(9))']"" S QACO(9)=" "
30HEADING ;This is for the display of data
31 W:$E(IOST)="C" @IOF
32 W !!,"** This information is not for the Patient Record **"
33 W !!,?28,"Report of Contact" S Y=DT D DD^%DT W ?60,"Date: ",Y,!
34 S N1=0 F S N1=$O(QACO(N1)) Q:N1="" S QACDATA=QACO(N1) D
35 .S FLD=N1*10\1,TEXT=$P($T(@FLD),";;",2),TAB=$P(TEXT,"^"),LINE=$P(TEXT,"^",2),CODE=$P(TEXT,"^",3,99)
36 .W:TAB=0 !
37 .W ?TAB,LINE
38 .X CODE
39 .Q
40 I $Y>(IOSL-5) D:$E(IOST)="C" PAUSE G QUIT:QACQUIT
41SOURCE ; Display either old Source of Contact field or new Sources(s) of
42 ; Contact multiple field.
43 N JJ,QACSOUR,QACSOURC
44 W ?45,"Source of Contact:"
45 S QACSOUR=$P($G(^QA(745.1,QAC,0)),U,11)
46 I $G(QACSOUR)]"" D
47 . W $S(QACSOUR="L":"Letter",QACSOUR="W":"Ward Visit",QACSOUR="V":"Visit",QACSOUR="P":"Phone",1:"")
48 I $D(^QA(745.1,QAC,12,0)) D
49 . S JJ=0
50 . F S JJ=$O(^QA(745.1,QAC,12,JJ)) Q:JJ'>0 D
51 . . S QACSOURC=^QA(745.1,QAC,12,JJ,0)
52 . . W ?63,$S(QACSOURC="L":"Letter",QACSOURC="W":"Ward Visit",QACSOURC="V":"Visit",QACSOURC="P":"Phone",QACSOURC="I":"Internet",1:""),!
53REFER S QACO(12)=0
54 W !,"Refer To:" F S QACO(12)=$O(^QA(745.1,QAC,11,QACO(12))) Q:QACO(12)'>0 D
55 . S QACREFER=$P($G(^QA(745.1,QAC,11,QACO(12),0)),U,1)
56 . W ?19,$P($G(^VA(200,QACREFER,0)),U,1),!
57WORDP1 G WORDP2:'$D(^QA(745.1,QAC,4,0))!(QACQUIT)
58 W !!,"Issue Text:" K ^UTILITY($J,"W") S DIWL=4,DIWR=75,DIWF=""
59 F N1=0:0 S N1=$O(^QA(745.1,QAC,4,N1)) Q:N1'>0 S X=^QA(745.1,QAC,4,N1,0) D ^DIWP
60 F N1=0:0 S N1=$O(^UTILITY($J,"W",DIWL,N1)) Q:N1'>0!QACQUIT D
61 .W !,?3,^UTILITY($J,"W",DIWL,N1,0) I $Y>(IOSL-5) D:$E(IOST)="C" PAUSE Q:QACQUIT D HEAD
62WORDP2 G QUIT:'$D(^QA(745.1,QAC,6,0))!(QACQUIT)!($G(QACRES)'=1)
63 W !!,"Resolution:" K ^UTILITY($J,"W") S DIWL=4,DIWR=75,DIWF=""
64 F N1=0:0 S N1=$O(^QA(745.1,QAC,6,N1)) Q:N1'>0 S X=^QA(745.1,QAC,6,N1,0) D ^DIWP
65 F N1=0:0 S N1=$O(^UTILITY($J,"W",DIWL,N1)) Q:N1'>0!QACQUIT D
66 .W !,?3,^UTILITY($J,"W",DIWL,N1,0) I $Y>(IOSL-5) D:$E(IOST)="C" PAUSE Q:QACQUIT D HEAD
67QUIT W ! D ^%ZISC S:$D(ZTQUEUED) ZTREQ="@"
68 K ^UTILITY($J),DIR,DIC,DIWF,DIWL,DIWR,CODE,N1,POP,QAC,QACO,QACDA0
69 K QACDA2,QACDATA,QACSTR,QACIS,QACQUIT,TEXT,TAB,LINE,FLD,N1,N2,J,X,Y
70 K ZTDESC,ZTRTN,ZTSAVE,%ZIS,%,C,QACRES,%DTC,X1,Y1,X2,QACREFER,DIRUT
71 Q
72PAUSE ;
73 W !! K DIR S DIR(0)="E" D ^DIR S QACQUIT=$S(Y'>0:1,1:0)
74 Q
75HEAD ;
76 W @IOF,!!,"** This information is not for the Patient Record **"
77 W !!,?20,"Report of Contact continued" S Y=DT D DD^%DT W ?60,"Date: ",Y,!
78 F N2=1:1:4 S:$D(QACO(N2)) QACDATA=QACO(N2) D
79 .I QACDATA="" W !! Q
80 .S FLD=N2*10\1,TEXT=$P($T(@FLD),";;",2),TAB=$P(TEXT,"^"),LINE=$P(TEXT,"^",2),CODE=$P(TEXT,"^",3,99)
81 .W:TAB=0 !
82 .W ?TAB,LINE
83 .X CODE
84 .Q
85 W !! Q
86TEXT ;
8710 ;;0^Contact Number:^W ?19,QACDATA
8820 ;;45^Date of Contact:^S Y=QACDATA D DD^%DT S QACDATA=Y W ?63,QACDATA
8930 ;;0^Patient Name:^W ?19,QACDATA
9040 ;;45^Patient SSN:^W ?63,QACDATA
9150 ;;0^Treatment Status:^W ?19,$S(QACDATA="I":"Inpatient",QACDATA="O":"Outpatient",QACDATA="D":"Domiciliary",QACDATA="N":"NHCU",QACDATA="L":"Long Term Psych",QACDATA="E":"Extended/Intermediate Care",QACDATA="H":"HBHC",1:"")
9260 ;;45^Location of Event:^W ?63,$P($G(^SC(+QACDATA,0)),"^",1)
9370 ;;0^Name of Contact:^W ?19,QACDATA
9480 ;;45^Phone of Contact:^W ?63,QACDATA
9590 ;;0^Date Due:^W ?19,QACDATA
96100 ;;45^Info taken by:^W ?63,$P($G(^VA(200,+QACDATA,0)),"^",1)
97120 ;;0^Elig. Status:^W ?19,$G(QACDATA)
Note: See TracBrowser for help on using the repository browser.