source: FOIAVistA/trunk/r/TOOLKIT-AWCM-XD-XIN-XPAR-XQAB-XT-XUC-XUR-ZIN-ZTED/XDRRMRG2.m@ 1470

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

initial load of FOIAVistA 6/30/08 version

File size: 3.6 KB
Line 
1XDRRMRG2 ;SF-IRMFO/GB,JLI - GET PATIENT HEALTH SUMMARY ;06/26/98 13:35
2 ;;7.3;TOOLKIT;**23,29**;Apr 25, 1995
3 ;;
4ASK(QLIST,ABORT) ; Report-specific questions
5 N DIC,Y,DTOUT,DUOUT
6 ; Which patient?
7 ; S DIC="^SPNL(154,"
8 ; S DIC("S")="I $P(^(0),U,3)=""A""" ; Select only from active patients
9 ; S DIC(0)="AEQM"
10 ; S DIC("A")="Select SCD Patient: "
11 ; S DIC("?")="Select the patient for whom you want the Health Summary"
12 ; D ^DIC I $D(DTOUT)!($D(DUOUT))!(Y<0) S ABORT=1 Q
13 ; S QLIST("DFN")=+Y ; IEN's are DINUM'd to the ^DPT
14 K DIC
15 ; Which Health Summary Type?
16 S DIC="^GMT(142,"
17 S DIC(0)="AEQM"
18 S DIC("A")="Select Health Summary Type Name: "
19 ;S DIC("?")="Choose one, if you aren't sure, experiment!"
20 D ^DIC I $D(DTOUT)!($D(DUOUT))!(Y<0) S ABORT=1 Q
21 S QLIST("TYPE")=+Y
22ASKX Q
23 ;
24GATHER(DFN,FDATE,TDATE,HIUSERS,QLIST) ; No need to gather
25 Q
26 ;
27PRINT(QLIST) ;Call to print health summary
28 D ENX^GMTSDVR(QLIST("DFN"),QLIST("TYPE"))
29PRINTX Q
30 ;
31PRINT2 ;Prints the record pair using the Browser of to a device.
32 N XDRIOP
33 W ! S DIR(0)="Y",DIR("A",1)="Would you like to use the FM Browser to"
34 S DIR("A")="view the record pair"
35 S DIR("B")="YES",DIR("?")="You may use FM Browser to view the record pair else you will be prompted to select a device for each record."
36 D ^DIR S:Y=1 XDRIOP=1 Q:$D(DIRUT)
37 K ^TMP("XDRRMRG1",$J),^TMP("XDRRMRG",$J)
38 ;S IOP="XDRBROWSER1" D ^%ZIS Q:POP ;Old code, delete after testing
39REC1 S:$D(XDRIOP) IOP="XDRBROWSER1" S:'$D(XDRIOP) %ZIS="QM"
40 S %ZIS("A")="DEVICE FOR FIRST RECORD: "
41 W ! D ^%ZIS Q:POP
42 I $D(IO("Q")) D G REC2 ;Will queue to TaskMan
43 . S ZTRTN="QUEUE^XDRRMRG2",ZTIO=ION,ZTDESC="XDR Health Summary for first patient."
44 . S DFN=DFNFRX,TYPE=QLIST("TYPE"),ZTSAVE("DFN")="",ZTSAVE("TYPE")=""
45 . D ^%ZTLOAD W:$D(ZTSK) !!,"Queued as task "_ZTSK,!
46 . Q
47 U IO(0) W:$D(XDRIOP) " Getting first entry ",!
48 D ENX^GMTSDVR(DFNFRX,QLIST("TYPE"))
49 U IO D ^%ZISC
50 S ^TMP("XDRRMRG",$J,"ENTER <PF1>S TO VIEW OTHER- "_$E($G(DFNFR(1)),1,30)_" "_$G(DFNFR(2))_" ("_DFNFRX_")")="^TMP(""XDRRMRG1"",$J,1)"
51 M ^TMP("XDRRMRG1",$J,1)=^TMP("DDB",$J)
52 ;S IOP="XDRBROWSER1" D ^%ZIS Q:POP ;old code delete after testing
53REC2 S:$D(XDRIOP) IOP="XDRBROWSER1" S:'$D(XDRIOP) %ZIS="QM"
54 S %ZIS("A")="DEVICE FOR SECOND RECORD: "
55 W ! D ^%ZIS Q:POP
56 I $D(IO("Q")) D G PRINTX ;Will queue to TaskMan
57 . S ZTRTN="QUEUE^XDRRMRG2",ZTIO=ION,ZTDESC="XDR Health Summary for second patient."
58 . S DFN=DFNTOX,TYPE=QLIST("TYPE"),ZTSAVE("DFN")="",ZTSAVE("TYPE")=""
59 . D ^%ZTLOAD W:$D(ZTSK) !!,"Queued as task "_ZTSK,!
60 . Q
61 U IO(0) W:$D(XDRIOP) " Getting second entry ",!
62 D ENX^GMTSDVR(DFNTOX,QLIST("TYPE"))
63 D ^%ZISC U IO(0)
64 S ^TMP("XDRRMRG",$J,"ENTER <PF1>S TO VIEW OTHER- "_$E($G(DFNTO(1)),1,30)_" "_$G(DFNTO(2))_" ("_DFNTOX_")")="^TMP(""XDRRMRG1"",$J,2)"
65 M ^TMP("XDRRMRG1",$J,2)=^TMP("DDB",$J)
66 D DOCLIST^DDBR($NA(^TMP("XDRRMRG",$J)),"R")
67 K ^TMP("XDRRMRG1",$J),^TMP("XDRRMRG",$J)
68PRINT2X Q
69 ;
70QUEUE ;Will process the print task for patients' health summaries.
71 D ENX^GMTSDVR(DFN,TYPE)
72QUEUEX Q
73 ;
74COUNT(XDRFILE,FROM,TO) ;
75 N X,I,FIL1,FIL2,NOD,PIECE,X1,X2,N1,N2
76 S N1=0,N2=0
77 S FIL2=^DIC(XDRFILE,0,"GL")
78 S FIL1=FIL2_"FROM)"
79 S FIL2=FIL2_"TO)"
80 F I=0:0 S I=$O(^DD(XDRFILE,I)) Q:I'>0 S X=^(I,0) D
81 . S NOD=$P($P(X,U,4),";")
82 . S PIECE=$P($P(X,U,4),";",2)
83 . I PIECE>0 D
84 . . S X1=$P($G(@FIL1@(NOD)),U,PIECE)
85 . . S X2=$P($G(@FIL2@(NOD)),U,PIECE)
86 . . I X1'="",X2="" S N1=N1+1
87 . . I X2'="",X1="" S N2=N2+1
88COUNTX Q $S(N1>N2:2,N2>N1:1,1:0)
89 ;
90LABIEN(FILE,REC) ;REM - Resolve LABs DFNFR and DFNTO.
91 S NAMREC=""
92 S FILDIC=$G(^DIC(FILE,0,"GL")) Q:FILDIC="" NAMREC
93 S FILREC=FILDIC_"REC)"
94 S NAMREC=+$P(@FILREC@(0),U,3)
95LABIENX Q NAMREC
Note: See TracBrowser for help on using the repository browser.