GMRCPSL1 ;SLC/MA - Special Consult Reports;25-Jul-2012 11:14;DU
;;3.0;CONSULT/REQUEST TRACKING;**23,22,1002,1003**;DEC 27, 1997;Build 14
;
; Modified - IHS/MSC/MGH - 09/20/2011 -
; This is the main entry routine for the Consult Reports that
; allow a user to search for consults by: Provider, Location,
; or Procedure. Also the user may select a date range and
; Consult status.
; The routines will not let the user search on any Inter-Facility
; information but will will use IFC when local fields are not present
EN ;
; GMRCARRY = used for entering more than one search value.
; This array will be used by all the diff searches.
; GMRCDT1 = Start date
; GMRCDT2 = Stop date
; GMRCEND = If equal to one end routine
; GMRCSRCH = Indicates which field to search on
; GMRCSTAT = Indicates which CPRS status to include
; GMRCRPT = 80 - 132 character report & data only output
; GMRCBRK = Print page break between sub-totals <Y-N>
; GMRTST = Include test pts or not Patch 1002
N GMRCDT1,GMRTST,GMRCDT2,GMRCARRY,GMRCSRCH,GMRCEND,GMRCSTAT,GMRCRPT,GMRCBRK
N GMRCQUIT
S (GMRCBRK,GMRCQUIT,GMRCEND)=0
S GMRCSRCH=$$GETSRCH ; Get search sequence
I GMRCSRCH=1 D ; Get Provider
. D GETPROV(.GMRCARRY) D
. . I '$D(GMRCARRY(1)) D WARNING
;
I GMRCSRCH=2 D ; Get Location
. D GETLOC(.GMRCARRY) D
. . I '$D(GMRCARRY(1)) D WARNING
;
I GMRCSRCH=3 D ; Get Procedure
. D GETPROC(.GMRCARRY) D
. . I '$D(GMRCARRY) D WARNING
I GMRCEND=1 K GMRCEND Q
S GMRTST=$$TESTPT^GMRCPC1() Q:GMRTST=1 ;Include test pts? Patch 1002
S GMRCRPT=$$TYPERPT Q:GMRCRPT=0 ; Get type or print
I GMRCRPT'=3 S GMRCBRK=$$PAGEBRK ; Break between sub-totals
I GMRCBRK>1 Q
D GETDATE I GMRCQUIT Q ; Get Date
I '$D(GMRCDT2) Q
S GMRCDT2=GMRCDT2+1
;
;
S GMRCSTAT=$$STS^GMRCPC1 Q:'GMRCSTAT ; Get search CPRS status
;
I GMRCRPT=0 Q
;
D DEVICE ; Get printer device
;
; At this point all user input has been collected
;
I $D(IO("Q")) D QUEUE Q
;
; Go build ^TMP("GMRCRPT",$J) using user input variables &
; write report
D PRINT^GMRCPSL2(GMRCSRCH,.GMRCARRY,GMRCDT1,GMRCDT2,GMRCSTAT,GMRCRPT,GMRCBRK,GMRTST) ;Report writer
KILL DIR,DIC,^TMP("GMRCRPT",$J)
Q
;
CHECK(GMRCDAT) ;CHECK FREE TEXT INPUT
N %DT,X,Y
I $E("ALL DATES",1,$L(GMRCDAT))=$$UP^XLFSTR(GMRCDAT) Q "ALL"
S %DT="E",X=GMRCDAT D ^%DT I Y<1 Q 0
Q +Y
I '$D(GMRCDT1) Q
I GMRCDT1="ALL" S GMRCDT1=0000000,GMRCDT2=9999999
Q
DEVICE ; device for printout of entries to group update
N %ZIS,POP
I GMRCRPT=2 D
. W !!,"You must configure your terminal so that it"
. W " will support 132 character"
. W !,"emulation and reply 132 to the right margin setting if"
. W " using HOME"
. W !,"as the device."
. W !,""
I GMRCRPT=3 D
. W !!,"OK, you have selected a TABLE output format."
. W !,"You must use your personal computer's terminal emulation"
. W !,"to capture the output:"
. W !,""
. W !," 1. Enter at the DEVICE: HOME// prompt "";250;99999999"
. W !," and do not hit the enter key."
. W !," 2. Open a capture file within your terminal emulation program."
. W !," 3. Hit enter to start the down load."
. W !," 4. Close the capture file when the output stops."
. W !,""
RETRY ;
S %ZIS="MQ"
D ^%ZIS
I POP S GMRCEND=1 Q
Q
;
GETDATE ;Get START and STOP dates
;GMRCDT1=Start date
;GMRCDT2=Stop date
N DTOUT,DIR,DUOUT,DIRUT,X,Y
GETDATE1 ;
S DIR(0)="FA^1:45",DIR("A")="List From Starting Date (ALL): "
S DIR("B")="T-30" D ^DIR
I $D(DUOUT)!($D(DTOUT)) S GMRCQUIT=1 Q
S GMRCDT1=$$CHECK(X)
I 'GMRCDT1,GMRCDT1'="ALL" G GETDATE1
I GMRCDT1="ALL" S GMRCDT1=0,GMRCDT2=9999999 Q
K DIR
S DIR(0)="DAO^::E",DIR("A")="List To This Ending Date: " D ^DIR
I $D(DTOUT)!($D(DUOUT)) K GMRCDT1,GMRCDT2 Q
I +Y=0 W "(NOW)" S GMRCDT2=$$DT^XLFDT Q
I +Y<GMRCDT1 S GMRCDT2=GMRCDT1,GMRCDT1=+Y
S:'$D(GMRCDT2) GMRCDT2=+Y
Q
;
; Get a Location
GETLOC(GMRCARRY) ;
; DBIA 10040 call DIC=44
N DIC,DIR,DIRUT,DUOUT,DTOUT,X,Y,GMRCCNTR,GMRCQLOC
S GMRCCNTR=0
S DIR(0)="Y",DIR("B")="NO"
S DIR("A")="Enter 'YES' if you want all LOCATIONS"
W !,""
D ^DIR
W !,""
I Y=1 S GMRCARRY(1)="ALL"
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
S DIR(0)="SA^L:LOCAL;R:REMOTE;B:BOTH LOCAL AND REMOTE LOCATIONS"
S DIR("A")=$S($D(GMRCARRY):"All ",1:"")_"(L)ocal, (R)emote, or (B)oth Local and Remote Locations: "
S DIR("B")="Local"
S DIR("?")="^D HELP^GMRCPSL1"
D ^DIR I $D(DIRUT) S GMRCEND=1 Q
S GMRCARRY=Y
Q:$D(GMRCARRY(1))
W !
I "LB"[GMRCARRY D
. S DIC=44,DIC(0)="AEMQ",DIC("A")="ENTER Local LOCATION: "
. F D ^DIC Q:$D(DUOUT)!($D(DTOUT))!(Y<0) D
. . S GMRCCNTR=GMRCCNTR+1
. . S GMRCARRY(GMRCCNTR)=Y_"^"_44
I "B"[GMRCARRY W !
I "RB"[GMRCARRY D
. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
. S DIR(0)="PO^4:EMQ"
. S DIR("S")="I $$STA^XUAF4(+Y)=+$$STA^XUAF4(+Y)"
. S DIR("A")="ENTER Remote LOCATION"
. S DIR("?")="For this report, Institution file (#4) entries are considered Remote locations."
. F D ^DIR S:$D(DTOUT) GMRCEND=1 S:$D(DUOUT) GMRCEND=1 Q:$D(DIRUT) D
. . S GMRCCNTR=GMRCCNTR+1
. . S GMRCARRY(GMRCCNTR)=Y_"^"_4
Q
;
; Get a Procedure
GETPROC(GMRCARRY) ;
N DIC,DIR,DIRUT,DUOUT,DTOUT,X,Y,GMRCCNTR,GMRCQPRC
S GMRCCNTR=0
S DIR(0)="Y",DIR("B")="NO"
S DIR("A")="Enter 'YES' if you want all PROCEDURES"
W !,""
D ^DIR
W !,""
I Y=1 S GMRCARRY(1)="ALL" Q
S DIC=123.3,DIC(0)="AEMQ",DIC("A")="ENTER PROCEDURE: "
F D ^DIC Q:$D(DUOUT)!($D(DTOUT))!(Y<0) D
. S GMRCCNTR=GMRCCNTR+1
. S GMRCARRY(GMRCCNTR)=Y
Q
;
; Get a Provider name
GETPROV(GMRCARRY) ;
; DBIA 10060 call DIC=200
N DIC,DIRUT,DUOUT,DTOUT,X,Y,GMRCCNTR,GMRCQPRV
S GMRCCNTR=0
S DIR(0)="Y",DIR("B")="NO"
S DIR("A")="Enter 'YES' if you want all PROVIDERS"
W !,""
D ^DIR
W !,""
I Y=1 S GMRCARRY(1)="ALL"
N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
S DIR(0)="SA^L:LOCAL;R:REMOTE;B:BOTH LOCAL AND REMOTE PROVIDERS"
S DIR("A")=$S($D(GMRCARRY):"All ",1:"")_"(L)ocal, (R)emote, or (B)oth Local and Remote Providers: "
S DIR("B")="Local"
S DIR("?")="^D HELP^GMRCPSL1"
D ^DIR I $D(DIRUT) S GMRCEND=1 Q
S GMRCARRY=Y
Q:$D(GMRCARRY(1))
W !
I "LB"[GMRCARRY D
. S DIC=200,DIC(0)="AEMQ",DIC("A")="ENTER Local PROVIDER: "
. F D ^DIC Q:$D(DUOUT)!($D(DTOUT))!(Y<0) D
. . S GMRCCNTR=GMRCCNTR+1
. . S GMRCARRY(GMRCCNTR)=Y_"^"_200
I "B"[GMRCARRY W !
I "RB"[GMRCARRY D
. N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
. S DIR(0)="FO^2:40^D UP^GMRCA2 K:'$D(^GMR(123,""AIP"",X)) X"
. S DIR("?")="^D HELPR^GMRCIR,HELPR^GMRCPSL1"
. S DIR("A")="ENTER Remote PROVIDER"
. F D ^DIR S:$D(DTOUT) GMRCEND=1 S:$D(DUOUT) GMRCEND=1 Q:$D(DIRUT) D
. . D UP^GMRCA2 S Y=X
. . S GMRCCNTR=GMRCCNTR+1
. . S GMRCARRY(GMRCCNTR)=Y
Q
HELP ; Help for location and provider prompts
W !!?3,"""Local"" refers to non-Inter-facility requests and Inter-"
W !?3,"facility requests originating locally."
W !?3,"""Remote"" only refers to Inter-facility requests originating"
W !?3,"at another site."
Q
HELPR ; Help for remote provider prompt
W:$Y>(IOSL-4) @IOF
W !!?3,"Enter the ENTIRE name in proper CASE, exactly as it"
W !?3,"appears in the above list (including any credentials)."
W !?3,"Use copy/paste to avoid typing errors."
W !?3,"NO partial matches are done."
W !
Q
GETSRCH() ; What search criteria should report be in???
N DIR,Y,X
S DIR("A",1)="Enter Search criteria:"
S DIR("A",2)=""
S DIR("A",3)=" 1 = Sending Provider"
S DIR("A",4)=" 2 = Location"
S DIR("A",5)=" 3 = Procedure"
S DIR("A",6)=""
S DIR("A")="Search criteria"
S DIR("B")=1
S DIR(0)="NO^1:3"
D ^DIR
I ($D(DTOUT)!$D(DUOUT)!$D(DIRUT)!$D(DIROUT)) S GMRCEND=1
Q Y
;
PAGEBRK() ; Does user want page breaks between sub-totals?
N DIR
S DIR(0)="Y"
S DIR("A")="Display sort sequence & page breaks between sub-totals"
S DIR("B")="YES"
D ^DIR I $D(DIRUT) Q 2
Q +Y
TYPERPT() ; Get type of report to print
N DIR
S DIR(0)="SO^1:80 column;2:132 column;3:Table Export"
S DIR("L",1)="Please select an output format from the following:"
S DIR("L",2)=""
S DIR("L",3)="1 - 80 column standard print [STANDARD]"
S DIR("L",4)="2 - 132 column standard print"
S DIR("L")="3 - Table without headers (export to another application)"
S DIR("B")=1
D ^DIR I $D(DIRUT)!(Y>3) Q 0
Q +Y
;
QUEUE ; send task for print and update
N ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSAVE,ZTSK
S ZTRTN="PRTTSK^GMRCPSL2",ZTDESC="PRINT OF RECORDS FILE 123"
S ZTIO=ION
S ZTSAVE("GMRC*")=""
D ^%ZTLOAD I $G(ZTSK) W !,"Task # ",ZTSK
I '$G(ZTSK) W !,"Unable to queue report! Try again later."
Q
WARNING ; Let user know that they did not enter any data.
W !!,"No search criteria was entered" H 1
S GMRCEND=1
Q
GMRCPSL1 ;SLC/MA - Special Consult Reports;25-Jul-2012 11:14;DU
+1 ;;3.0;CONSULT/REQUEST TRACKING;**23,22,1002,1003**;DEC 27, 1997;Build 14
+2 ;
+3 ; Modified - IHS/MSC/MGH - 09/20/2011 -
+4 ; This is the main entry routine for the Consult Reports that
+5 ; allow a user to search for consults by: Provider, Location,
+6 ; or Procedure. Also the user may select a date range and
+7 ; Consult status.
+8 ; The routines will not let the user search on any Inter-Facility
+9 ; information but will will use IFC when local fields are not present
EN ;
+1 ; GMRCARRY = used for entering more than one search value.
+2 ; This array will be used by all the diff searches.
+3 ; GMRCDT1 = Start date
+4 ; GMRCDT2 = Stop date
+5 ; GMRCEND = If equal to one end routine
+6 ; GMRCSRCH = Indicates which field to search on
+7 ; GMRCSTAT = Indicates which CPRS status to include
+8 ; GMRCRPT = 80 - 132 character report & data only output
+9 ; GMRCBRK = Print page break between sub-totals <Y-N>
+10 ; GMRTST = Include test pts or not Patch 1002
+11 NEW GMRCDT1,GMRTST,GMRCDT2,GMRCARRY,GMRCSRCH,GMRCEND,GMRCSTAT,GMRCRPT,GMRCBRK
+12 NEW GMRCQUIT
+13 SET (GMRCBRK,GMRCQUIT,GMRCEND)=0
+14 ; Get search sequence
SET GMRCSRCH=$$GETSRCH
+15 ; Get Provider
IF GMRCSRCH=1
Begin DoDot:1
+16 DO GETPROV(.GMRCARRY)
Begin DoDot:2
+17 IF '$DATA(GMRCARRY(1))
DO WARNING
End DoDot:2
End DoDot:1
+18 ;
+19 ; Get Location
IF GMRCSRCH=2
Begin DoDot:1
+20 DO GETLOC(.GMRCARRY)
Begin DoDot:2
+21 IF '$DATA(GMRCARRY(1))
DO WARNING
End DoDot:2
End DoDot:1
+22 ;
+23 ; Get Procedure
IF GMRCSRCH=3
Begin DoDot:1
+24 DO GETPROC(.GMRCARRY)
Begin DoDot:2
+25 IF '$DATA(GMRCARRY)
DO WARNING
End DoDot:2
End DoDot:1
+26 IF GMRCEND=1
KILL GMRCEND
QUIT
+27 ;Include test pts? Patch 1002
SET GMRTST=$$TESTPT^GMRCPC1()
IF GMRTST=1
QUIT
+28 ; Get type or print
SET GMRCRPT=$$TYPERPT
IF GMRCRPT=0
QUIT
+29 ; Break between sub-totals
IF GMRCRPT'=3
SET GMRCBRK=$$PAGEBRK
+30 IF GMRCBRK>1
QUIT
+31 ; Get Date
DO GETDATE
IF GMRCQUIT
QUIT
+32 IF '$DATA(GMRCDT2)
QUIT
+33 SET GMRCDT2=GMRCDT2+1
+34 ;
+35 ;
+36 ; Get search CPRS status
SET GMRCSTAT=$$STS^GMRCPC1
IF 'GMRCSTAT
QUIT
+37 ;
+38 IF GMRCRPT=0
QUIT
+39 ;
+40 ; Get printer device
DO DEVICE
+41 ;
+42 ; At this point all user input has been collected
+43 ;
+44 IF $DATA(IO("Q"))
DO QUEUE
QUIT
+45 ;
+46 ; Go build ^TMP("GMRCRPT",$J) using user input variables &
+47 ; write report
+48 ;Report writer
DO PRINT^GMRCPSL2(GMRCSRCH,.GMRCARRY,GMRCDT1,GMRCDT2,GMRCSTAT,GMRCRPT,GMRCBRK,GMRTST)
+49 KILL DIR,DIC,^TMP("GMRCRPT",$JOB)
+50 QUIT
+51 ;
CHECK(GMRCDAT) ;CHECK FREE TEXT INPUT
+1 NEW %DT,X,Y
+2 IF $EXTRACT("ALL DATES",1,$LENGTH(GMRCDAT))=$$UP^XLFSTR(GMRCDAT)
QUIT "ALL"
+3 SET %DT="E"
SET X=GMRCDAT
DO ^%DT
IF Y<1
QUIT 0
+4 QUIT +Y
+5 IF '$DATA(GMRCDT1)
QUIT
+6 IF GMRCDT1="ALL"
SET GMRCDT1=0000000
SET GMRCDT2=9999999
+7 QUIT
DEVICE ; device for printout of entries to group update
+1 NEW %ZIS,POP
+2 IF GMRCRPT=2
Begin DoDot:1
+3 WRITE !!,"You must configure your terminal so that it"
+4 WRITE " will support 132 character"
+5 WRITE !,"emulation and reply 132 to the right margin setting if"
+6 WRITE " using HOME"
+7 WRITE !,"as the device."
+8 WRITE !,""
End DoDot:1
+9 IF GMRCRPT=3
Begin DoDot:1
+10 WRITE !!,"OK, you have selected a TABLE output format."
+11 WRITE !,"You must use your personal computer's terminal emulation"
+12 WRITE !,"to capture the output:"
+13 WRITE !,""
+14 WRITE !," 1. Enter at the DEVICE: HOME// prompt "";250;99999999"
+15 WRITE !," and do not hit the enter key."
+16 WRITE !," 2. Open a capture file within your terminal emulation program."
+17 WRITE !," 3. Hit enter to start the down load."
+18 WRITE !," 4. Close the capture file when the output stops."
+19 WRITE !,""
End DoDot:1
RETRY ;
+1 SET %ZIS="MQ"
+2 DO ^%ZIS
+3 IF POP
SET GMRCEND=1
QUIT
+4 QUIT
+5 ;
GETDATE ;Get START and STOP dates
+1 ;GMRCDT1=Start date
+2 ;GMRCDT2=Stop date
+3 NEW DTOUT,DIR,DUOUT,DIRUT,X,Y
GETDATE1 ;
+1 SET DIR(0)="FA^1:45"
SET DIR("A")="List From Starting Date (ALL): "
+2 SET DIR("B")="T-30"
DO ^DIR
+3 IF $DATA(DUOUT)!($DATA(DTOUT))
SET GMRCQUIT=1
QUIT
+4 SET GMRCDT1=$$CHECK(X)
+5 IF 'GMRCDT1
IF GMRCDT1'="ALL"
GOTO GETDATE1
+6 IF GMRCDT1="ALL"
SET GMRCDT1=0
SET GMRCDT2=9999999
QUIT
+7 KILL DIR
+8 SET DIR(0)="DAO^::E"
SET DIR("A")="List To This Ending Date: "
DO ^DIR
+9 IF $DATA(DTOUT)!($DATA(DUOUT))
KILL GMRCDT1,GMRCDT2
QUIT
+10 IF +Y=0
WRITE "(NOW)"
SET GMRCDT2=$$DT^XLFDT
QUIT
+11 IF +Y<GMRCDT1
SET GMRCDT2=GMRCDT1
SET GMRCDT1=+Y
+12 IF '$DATA(GMRCDT2)
SET GMRCDT2=+Y
+13 QUIT
+14 ;
+15 ; Get a Location
GETLOC(GMRCARRY) ;
+1 ; DBIA 10040 call DIC=44
+2 NEW DIC,DIR,DIRUT,DUOUT,DTOUT,X,Y,GMRCCNTR,GMRCQLOC
+3 SET GMRCCNTR=0
+4 SET DIR(0)="Y"
SET DIR("B")="NO"
+5 SET DIR("A")="Enter 'YES' if you want all LOCATIONS"
+6 WRITE !,""
+7 DO ^DIR
+8 WRITE !,""
+9 IF Y=1
SET GMRCARRY(1)="ALL"
+10 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+11 SET DIR(0)="SA^L:LOCAL;R:REMOTE;B:BOTH LOCAL AND REMOTE LOCATIONS"
+12 SET DIR("A")=$SELECT($DATA(GMRCARRY):"All ",1:"")_"(L)ocal, (R)emote, or (B)oth Local and Remote Locations: "
+13 SET DIR("B")="Local"
+14 SET DIR("?")="^D HELP^GMRCPSL1"
+15 DO ^DIR
IF $DATA(DIRUT)
SET GMRCEND=1
QUIT
+16 SET GMRCARRY=Y
+17 IF $DATA(GMRCARRY(1))
QUIT
+18 WRITE !
+19 IF "LB"[GMRCARRY
Begin DoDot:1
+20 SET DIC=44
SET DIC(0)="AEMQ"
SET DIC("A")="ENTER Local LOCATION: "
+21 FOR
DO ^DIC
IF $DATA(DUOUT)!($DATA(DTOUT))!(Y<0)
QUIT
Begin DoDot:2
+22 SET GMRCCNTR=GMRCCNTR+1
+23 SET GMRCARRY(GMRCCNTR)=Y_"^"_44
End DoDot:2
End DoDot:1
+24 IF "B"[GMRCARRY
WRITE !
+25 IF "RB"[GMRCARRY
Begin DoDot:1
+26 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+27 SET DIR(0)="PO^4:EMQ"
+28 SET DIR("S")="I $$STA^XUAF4(+Y)=+$$STA^XUAF4(+Y)"
+29 SET DIR("A")="ENTER Remote LOCATION"
+30 SET DIR("?")="For this report, Institution file (#4) entries are considered Remote locations."
+31 FOR
DO ^DIR
IF $DATA(DTOUT)
SET GMRCEND=1
IF $DATA(DUOUT)
SET GMRCEND=1
IF $DATA(DIRUT)
QUIT
Begin DoDot:2
+32 SET GMRCCNTR=GMRCCNTR+1
+33 SET GMRCARRY(GMRCCNTR)=Y_"^"_4
End DoDot:2
End DoDot:1
+34 QUIT
+35 ;
+36 ; Get a Procedure
GETPROC(GMRCARRY) ;
+1 NEW DIC,DIR,DIRUT,DUOUT,DTOUT,X,Y,GMRCCNTR,GMRCQPRC
+2 SET GMRCCNTR=0
+3 SET DIR(0)="Y"
SET DIR("B")="NO"
+4 SET DIR("A")="Enter 'YES' if you want all PROCEDURES"
+5 WRITE !,""
+6 DO ^DIR
+7 WRITE !,""
+8 IF Y=1
SET GMRCARRY(1)="ALL"
QUIT
+9 SET DIC=123.3
SET DIC(0)="AEMQ"
SET DIC("A")="ENTER PROCEDURE: "
+10 FOR
DO ^DIC
IF $DATA(DUOUT)!($DATA(DTOUT))!(Y<0)
QUIT
Begin DoDot:1
+11 SET GMRCCNTR=GMRCCNTR+1
+12 SET GMRCARRY(GMRCCNTR)=Y
End DoDot:1
+13 QUIT
+14 ;
+15 ; Get a Provider name
GETPROV(GMRCARRY) ;
+1 ; DBIA 10060 call DIC=200
+2 NEW DIC,DIRUT,DUOUT,DTOUT,X,Y,GMRCCNTR,GMRCQPRV
+3 SET GMRCCNTR=0
+4 SET DIR(0)="Y"
SET DIR("B")="NO"
+5 SET DIR("A")="Enter 'YES' if you want all PROVIDERS"
+6 WRITE !,""
+7 DO ^DIR
+8 WRITE !,""
+9 IF Y=1
SET GMRCARRY(1)="ALL"
+10 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+11 SET DIR(0)="SA^L:LOCAL;R:REMOTE;B:BOTH LOCAL AND REMOTE PROVIDERS"
+12 SET DIR("A")=$SELECT($DATA(GMRCARRY):"All ",1:"")_"(L)ocal, (R)emote, or (B)oth Local and Remote Providers: "
+13 SET DIR("B")="Local"
+14 SET DIR("?")="^D HELP^GMRCPSL1"
+15 DO ^DIR
IF $DATA(DIRUT)
SET GMRCEND=1
QUIT
+16 SET GMRCARRY=Y
+17 IF $DATA(GMRCARRY(1))
QUIT
+18 WRITE !
+19 IF "LB"[GMRCARRY
Begin DoDot:1
+20 SET DIC=200
SET DIC(0)="AEMQ"
SET DIC("A")="ENTER Local PROVIDER: "
+21 FOR
DO ^DIC
IF $DATA(DUOUT)!($DATA(DTOUT))!(Y<0)
QUIT
Begin DoDot:2
+22 SET GMRCCNTR=GMRCCNTR+1
+23 SET GMRCARRY(GMRCCNTR)=Y_"^"_200
End DoDot:2
End DoDot:1
+24 IF "B"[GMRCARRY
WRITE !
+25 IF "RB"[GMRCARRY
Begin DoDot:1
+26 NEW DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
+27 SET DIR(0)="FO^2:40^D UP^GMRCA2 K:'$D(^GMR(123,""AIP"",X)) X"
+28 SET DIR("?")="^D HELPR^GMRCIR,HELPR^GMRCPSL1"
+29 SET DIR("A")="ENTER Remote PROVIDER"
+30 FOR
DO ^DIR
IF $DATA(DTOUT)
SET GMRCEND=1
IF $DATA(DUOUT)
SET GMRCEND=1
IF $DATA(DIRUT)
QUIT
Begin DoDot:2
+31 DO UP^GMRCA2
SET Y=X
+32 SET GMRCCNTR=GMRCCNTR+1
+33 SET GMRCARRY(GMRCCNTR)=Y
End DoDot:2
End DoDot:1
+34 QUIT
HELP ; Help for location and provider prompts
+1 WRITE !!?3,"""Local"" refers to non-Inter-facility requests and Inter-"
+2 WRITE !?3,"facility requests originating locally."
+3 WRITE !?3,"""Remote"" only refers to Inter-facility requests originating"
+4 WRITE !?3,"at another site."
+5 QUIT
HELPR ; Help for remote provider prompt
+1 IF $Y>(IOSL-4)
WRITE @IOF
+2 WRITE !!?3,"Enter the ENTIRE name in proper CASE, exactly as it"
+3 WRITE !?3,"appears in the above list (including any credentials)."
+4 WRITE !?3,"Use copy/paste to avoid typing errors."
+5 WRITE !?3,"NO partial matches are done."
+6 WRITE !
+7 QUIT
GETSRCH() ; What search criteria should report be in???
+1 NEW DIR,Y,X
+2 SET DIR("A",1)="Enter Search criteria:"
+3 SET DIR("A",2)=""
+4 SET DIR("A",3)=" 1 = Sending Provider"
+5 SET DIR("A",4)=" 2 = Location"
+6 SET DIR("A",5)=" 3 = Procedure"
+7 SET DIR("A",6)=""
+8 SET DIR("A")="Search criteria"
+9 SET DIR("B")=1
+10 SET DIR(0)="NO^1:3"
+11 DO ^DIR
+12 IF ($DATA(DTOUT)!$DATA(DUOUT)!$DATA(DIRUT)!$DATA(DIROUT))
SET GMRCEND=1
+13 QUIT Y
+14 ;
PAGEBRK() ; Does user want page breaks between sub-totals?
+1 NEW DIR
+2 SET DIR(0)="Y"
+3 SET DIR("A")="Display sort sequence & page breaks between sub-totals"
+4 SET DIR("B")="YES"
+5 DO ^DIR
IF $DATA(DIRUT)
QUIT 2
+6 QUIT +Y
TYPERPT() ; Get type of report to print
+1 NEW DIR
+2 SET DIR(0)="SO^1:80 column;2:132 column;3:Table Export"
+3 SET DIR("L",1)="Please select an output format from the following:"
+4 SET DIR("L",2)=""
+5 SET DIR("L",3)="1 - 80 column standard print [STANDARD]"
+6 SET DIR("L",4)="2 - 132 column standard print"
+7 SET DIR("L")="3 - Table without headers (export to another application)"
+8 SET DIR("B")=1
+9 DO ^DIR
IF $DATA(DIRUT)!(Y>3)
QUIT 0
+10 QUIT +Y
+11 ;
QUEUE ; send task for print and update
+1 NEW ZTRTN,ZTDESC,ZTIO,ZTDTH,ZTSAVE,ZTSK
+2 SET ZTRTN="PRTTSK^GMRCPSL2"
SET ZTDESC="PRINT OF RECORDS FILE 123"
+3 SET ZTIO=ION
+4 SET ZTSAVE("GMRC*")=""
+5 DO ^%ZTLOAD
IF $GET(ZTSK)
WRITE !,"Task # ",ZTSK
+6 IF '$GET(ZTSK)
WRITE !,"Unable to queue report! Try again later."
+7 QUIT
WARNING ; Let user know that they did not enter any data.
+1 WRITE !!,"No search criteria was entered"
HANG 1
+2 SET GMRCEND=1
+3 QUIT