[613] | 1 | GMRCIR ;SLC/JAK - IFC Request data & statistics ;03/05/02 08:20
|
---|
| 2 | ;;3.0;CONSULT/REQUEST TRACKING;**22**;DEC 27, 1997
|
---|
| 3 | EN ; -- main entry point for GMRC IF CONSULTS
|
---|
| 4 | K GMRCSVC,GMRCSVCP
|
---|
| 5 | N GMRCCK,GMRCDG,GMRCIS,GMRCSTAT
|
---|
| 6 | N GMRCDT1,GMRCDT2,GMRCEDT1,GMRCEDT2
|
---|
| 7 | I $D(GMRCREMP),$D(GMRCRF) D
|
---|
| 8 | .I '$D(^GMR(123,"AIP")) D
|
---|
| 9 | ..W !!,$C(7),"No entries with Remote Ordering Provider data.",!
|
---|
| 10 | ..S GMRCQUT=1
|
---|
| 11 | .E D
|
---|
| 12 | ..N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
|
---|
| 13 | ..S DIR(0)="PO^4:EMQ"
|
---|
| 14 | ..S DIR("S")="I $$STA^XUAF4(+Y)=+$$STA^XUAF4(+Y)"
|
---|
| 15 | ..S DIR("A")="Select Requesting site"
|
---|
| 16 | ..D ^DIR I $D(DIRUT) S GMRCQUT=1 Q
|
---|
| 17 | ..S GMRCRF=+Y
|
---|
| 18 | ..W !
|
---|
| 19 | ..N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
|
---|
| 20 | ..S DIR(0)="FO^2:40^D UP^GMRCA2 K:'$D(^GMR(123,""AIP"",X)) X"
|
---|
| 21 | ..S DIR("?")="^D HELPR^GMRCIR"
|
---|
| 22 | ..S DIR("A",1)=" Enter the ENTIRE name in proper CASE, exactly as it"
|
---|
| 23 | ..S DIR("A",2)=" appears in the list (including any credentials)."
|
---|
| 24 | ..S DIR("A",3)=" Use copy/paste to avoid typing errors."
|
---|
| 25 | ..S DIR("A",4)=" NO partial matches are done."
|
---|
| 26 | ..S DIR("A",5)=" Enter ? to display a list of possible entries."
|
---|
| 27 | ..S DIR("A")="Select Remote Ordering Provider"
|
---|
| 28 | ..D ^DIR I $D(DIRUT) S GMRCQUT=1 Q
|
---|
| 29 | ..D UP^GMRCA2 S Y=X,GMRCREMP=Y
|
---|
| 30 | .S GMRCIS="C"
|
---|
| 31 | E D
|
---|
| 32 | .N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
|
---|
| 33 | .S DIR(0)="SB^R:REQUESTING;C:CONSULTING"
|
---|
| 34 | .S DIR("A")="Are you the Requesting site or the Consulting site"
|
---|
| 35 | .D ^DIR I $D(DIRUT) S GMRCQUT=1 Q
|
---|
| 36 | .S GMRCIS=Y
|
---|
| 37 | I $D(GMRCQUT) D EXIT Q
|
---|
| 38 | ;Get the statuses
|
---|
| 39 | S GMRCSTAT=$$STS^GMRCPC1
|
---|
| 40 | I $D(GMRCQUT) D EXIT Q
|
---|
| 41 | I $D(GMRCEACT),$L(GMRCEACT) D I '$D(^GMR(123.5,$G(GMRCSVC),0)) D EXIT Q
|
---|
| 42 | .S GMRCSVCP=GMRCEACT
|
---|
| 43 | .S GMRCSVC=$O(^GMR(123.5,"B",GMRCSVCP,0))
|
---|
| 44 | .Q:'$D(^GMR(123.5,$G(GMRCSVC),0))
|
---|
| 45 | .;Build service array
|
---|
| 46 | .S GMRCDG=GMRCSVC
|
---|
| 47 | .D SERV1^GMRCASV
|
---|
| 48 | .;Set date range to ALL
|
---|
| 49 | .S GMRCDT1="ALL"
|
---|
| 50 | .S GMRCDT2=0
|
---|
| 51 | .D LISTDATE^GMRCSTU1(GMRCDT1,GMRCDT2,.GMRCEDT1,.GMRCEDT2)
|
---|
| 52 | ;If no service ask for one
|
---|
| 53 | I '$L($G(GMRCSVC)) D EN^GMRCSTLM I $D(GMRCQUT) D EXIT Q
|
---|
| 54 | ;Quit if no array of services
|
---|
| 55 | I '$O(^TMP("GMRCSLIST",$J,0)) S GMRCQUT=1 D EXIT Q
|
---|
| 56 | ;
|
---|
| 57 | D EN^VALM("GMRC IF CONSULTS")
|
---|
| 58 | Q
|
---|
| 59 | ;
|
---|
| 60 | HDR ; -- header code
|
---|
| 61 | Q:$D(GMRCQUT)!'$D(GMRCCT)
|
---|
| 62 | S VALMHDR(1)="IFC Requests: "_$S(GMRCIS="R":"Requesting",1:"Consulting")_" Site"
|
---|
| 63 | S VALMHDR(2)="Service: "_GMRCHEAD
|
---|
| 64 | S VALMHDR(3)="From: "_$G(GMRCEDT1)_" To: "_$G(GMRCEDT2)
|
---|
| 65 | I $G(GMRCCTRL)=1 S VALMCAP=" "_VALMCAP
|
---|
| 66 | Q
|
---|
| 67 | ;
|
---|
| 68 | HELP ; -- help code
|
---|
| 69 | S X="?" D DISP^XQORM1 W !!
|
---|
| 70 | Q
|
---|
| 71 | ;
|
---|
| 72 | EXIT ; -- exit code
|
---|
| 73 | K CNT,CTRLCOL,GMRCCT,GMRCQUT,GMRCSVC,GMRCSVCP,VALMHDR
|
---|
| 74 | K GMRCEDT1,GMRCEDT2,GMRCSVNM
|
---|
| 75 | K GMRCCTRL,GMRCSTAT,GMRCARRN
|
---|
| 76 | K ^TMP("GMRCS",$J),^TMP("GMRCSLIST",$J),^TMP("GMRCR",$J,"IFC"),^TMP("GMRCRINDEX",$J),^TMP("GMRCTOT",$J)
|
---|
| 77 | Q
|
---|
| 78 | ;
|
---|
| 79 | EXPND ; -- expand code
|
---|
| 80 | Q
|
---|
| 81 | ;
|
---|
| 82 | CWIDTH(GMRCCTRL) ;Prints a message about how wide the report is.
|
---|
| 83 | N WIDTH
|
---|
| 84 | S WIDTH=128
|
---|
| 85 | I GMRCCTRL#100\10 D
|
---|
| 86 | .I GMRCCTRL#100\10=1 S WIDTH=WIDTH+5
|
---|
| 87 | .E S WIDTH=WIDTH+10
|
---|
| 88 | I GMRCCTRL#1000\100 S WIDTH=WIDTH-6
|
---|
| 89 | Q WIDTH
|
---|
| 90 | ;
|
---|
| 91 | PWIDTH(GMRCCTRL) ;Prints a message about how wide the report is.
|
---|
| 92 | W !!,"This print out is "_$$CWIDTH(GMRCCTRL)_" columns wide."
|
---|
| 93 | Q
|
---|
| 94 | ;
|
---|
| 95 | HELPR ;Help for Remote Ordering Provider prompt
|
---|
| 96 | N GMRCRP,GMRCQUT
|
---|
| 97 | S GMRCRP=""
|
---|
| 98 | W @IOF
|
---|
| 99 | F S GMRCRP=$O(^GMR(123,"AIP",GMRCRP)) Q:GMRCRP=""!$D(GMRCQUT) D
|
---|
| 100 | .W GMRCRP,!
|
---|
| 101 | .I $Y>(IOSL-4) N X,Y D W:Y @IOF I 'Y S GMRCQUT=1 Q
|
---|
| 102 | ..N DIR,DIROUT,DIRUT,DTOUT,DUOUT
|
---|
| 103 | ..S DIR(0)="E" D ^DIR
|
---|
| 104 | I $D(GMRCQUT) Q
|
---|
| 105 | N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
|
---|
| 106 | S DIR(0)="E",DIR("A")="Enter RETURN or '^' to exit" D ^DIR
|
---|
| 107 | Q
|
---|
| 108 | ;
|
---|
| 109 | DESC ;Displays Description from Option file
|
---|
| 110 | N GMRCDESC,GMRCNUM,GMRCOPT,GMRCOPTN,GMRCQUT
|
---|
| 111 | S GMRCNUM=""
|
---|
| 112 | S GMRCOPTN="GMRC IFC RPT CONSULTS"
|
---|
| 113 | S GMRCOPT=$$FIND1^DIC(19,"","X",GMRCOPTN)
|
---|
| 114 | I 'GMRCOPT Q
|
---|
| 115 | S GMRCDESC=$$GET1^DIQ(19,GMRCOPT,3.5,"","GMRCDESC") ; DBIA #10075
|
---|
| 116 | I '$O(GMRCDESC(0)) Q
|
---|
| 117 | W @IOF F S GMRCNUM=$O(GMRCDESC(GMRCNUM)) Q:GMRCNUM=""!$D(GMRCQUT) D
|
---|
| 118 | .W GMRCDESC(GMRCNUM),!
|
---|
| 119 | .I $Y>(IOSL-4) N X,Y D W:+Y @IOF I '+Y S GMRCQUT=1 Q
|
---|
| 120 | ..N DIR,DIROUT,DIRUT,DTOUT,DUOUT
|
---|
| 121 | ..S DIR(0)="E" D ^DIR
|
---|
| 122 | I $D(GMRCQUT) Q
|
---|
| 123 | N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
|
---|
| 124 | S DIR(0)="E",DIR("A")="Enter RETURN or '^' to exit" D ^DIR
|
---|
| 125 | Q
|
---|
| 126 | ;
|
---|
| 127 | PRNTONLY(GMRCCTRL) ;Option to just send the report to a device.
|
---|
| 128 | N GMRCQUT,RETURN,GMRCDG,GMRCSTAT,VALMBCK
|
---|
| 129 | N GMRCDT1,GMRCDT2,GMRCEDT1,GMRCEDT2
|
---|
| 130 | N DIR,DIROUT,DIRUT,DTOUT,DUOUT,GMRCIS,GMRCCK,X,Y
|
---|
| 131 | S DIR(0)="SB^R:REQUESTING;C:CONSULTING"
|
---|
| 132 | S DIR("A")="Are you the Requesting site or the Consulting site"
|
---|
| 133 | D ^DIR Q:$D(DIRUT) S GMRCIS=Y
|
---|
| 134 | ;Get the statuses
|
---|
| 135 | S GMRCSTAT=$$STS^GMRCPC1
|
---|
| 136 | I $D(GMRCQUT) D EXIT Q
|
---|
| 137 | ;Get the service and date range.
|
---|
| 138 | D EN^GMRCSTLM
|
---|
| 139 | I $D(GMRCQUT) D EXIT Q
|
---|
| 140 | ;Quit if no array of services
|
---|
| 141 | I '$O(^TMP("GMRCSLIST",$J,0)) S GMRCQUT=1 D EXIT Q
|
---|
| 142 | I '($D(GMRCCTRL)#2) S GMRCCTRL=0 ; default to just the list
|
---|
| 143 | ;Get description?
|
---|
| 144 | N DIR,DIROUT,DIRUT,DTOUT,DUOUT,X,Y
|
---|
| 145 | S DIR(0)="Y",DIR("B")="NO"
|
---|
| 146 | S DIR("A")="Want to view a description of the data for this report now"
|
---|
| 147 | D ^DIR I $D(DIRUT) D EXIT Q
|
---|
| 148 | I Y>0 D DESC
|
---|
| 149 | D PWIDTH(GMRCCTRL)
|
---|
| 150 | ;Get the device
|
---|
| 151 | D PRNTASK^GMRCSTU
|
---|
| 152 | I $D(GMRCQUT) D EXIT Q
|
---|
| 153 | ;Save some things if the report is queued
|
---|
| 154 | I $D(IO("Q")) D
|
---|
| 155 | .S ZTSAVE("GMRCCTRL")=""
|
---|
| 156 | .S ZTSAVE("GMRCIS")=""
|
---|
| 157 | .S ZTSAVE("GMRCSTAT")=""
|
---|
| 158 | ;Create the report if not queued
|
---|
| 159 | E D ENOR^GMRCSTLM(.RETURN,GMRCDG,GMRCDT1,GMRCDT2,GMRCSTAT,GMRCCTRL,"IFC")
|
---|
| 160 | ;Print the report
|
---|
| 161 | D PRNTIT^GMRCSTU("IFC","PRNTQ^GMRCIR","CONSULT/REQUEST PACKAGE PRINT INTER-FACILITY CONSULT REQUESTS FROM OPTION")
|
---|
| 162 | D EXIT
|
---|
| 163 | Q
|
---|
| 164 | ;
|
---|
| 165 | PRNTQ ;Print Queued report from ^TMP global then kill off ^TMP & ^XTMP
|
---|
| 166 | ;Create the report
|
---|
| 167 | N RETURN,INDEX
|
---|
| 168 | D ENOR^GMRCSTLM(.RETURN,GMRCDG,GMRCDT1,GMRCDT2,GMRCSTAT,GMRCCTRL,"IFC")
|
---|
| 169 | U IO
|
---|
| 170 | S INDEX=""
|
---|
| 171 | F S INDEX=$O(^TMP("GMRCR",$J,TMPNAME,INDEX)) Q:INDEX="" W ^TMP("GMRCR",$J,TMPNAME,INDEX,0),!
|
---|
| 172 | K ^TMP("GMRCR",$J,TMPNAME),^XTMP("GMRCR",J,DOLLARH,"PRINT"),J,DOLLARH
|
---|
| 173 | D ^%ZISC
|
---|
| 174 | D EXIT
|
---|
| 175 | Q
|
---|
| 176 | ;
|
---|