source: WorldVistAEHR/trunk/r/CONSULT_REQUEST_TRACKING-GMRC-GMRS-GMRT/GMRCIAIT.m@ 1556

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

initial load of WorldVistAEHR

File size: 2.7 KB
Line 
1GMRCIAIT ;SLC/JFR - PRINT ALL INC. IFC TRANSACTIONS; 12/18/02 09:11
2 ;;3.0;CONSULT/REQUEST TRACKING;**30**;DEC 27, 1997
3EN ; get the device to use
4 N %ZIS,POP
5 S %ZIS="QM" D ^%ZIS
6 I POP D HOME^%ZIS Q
7 I $D(IO("Q")) D D ^%ZISC,HOME^%ZIS Q
8 . N ZTRTN,ZTSK,ZTIO,ZTDTH,ZTDESC
9 . S ZTRTN="RPT^GMRCIAIT",ZTDESC="Incomplete IFC Transaction report"
10 . S ZTIO=ION,ZTDTH=$H
11 . D ^%ZTLOAD
12 . I $G(ZTSK) W !,"Queued to Print, Task # ",ZTSK
13 . E W !,"Sorry, Try again Later"
14 D RPT
15 D ^%ZISC,HOME^%ZIS
16 Q
17RPT ; sort logic
18 I $D(ZTQUEUED) S ZTREQ="@"
19 U IO
20 N GMRCDA,GMRCPAGE,GMRCQT
21 S GMRCDA=0,GMRCPAGE=1
22 I '$O(^GMR(123.6,"AC",GMRCDA)) D HDR(.GMRCPAGE),NOREC Q
23 D HDR(.GMRCPAGE)
24 F S GMRCDA=$O(^GMR(123.6,"AC",GMRCDA)) Q:'GMRCDA!($D(GMRCQT)) D
25 . I $Y>(IOSL-9) D Q:$D(GMRCQT)
26 .. N DIR,DIRUT,DIROUT,DUOUT,DTOUT
27 .. ;W !
28 .. I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR
29 .. I $D(DIRUT) S GMRCQT=1 Q
30 .. D HDR(.GMRCPAGE)
31 . W !!,?11,"CONSULT/REQUEST #: ",GMRCDA
32 . N GMRCACT,GMRCLOG
33 . S GMRCACT=0
34 . F S GMRCACT=$O(^GMR(123.6,"AC",GMRCDA,GMRCACT)) Q:'GMRCACT!($D(GMRCQT)) D
35 .. S GMRCLOG=$O(^GMR(123.6,"AC",GMRCDA,GMRCACT,1,0)) Q:'GMRCLOG
36 .. I $Y>(IOSL-8) D Q:$D(GMRCQT)
37 ... N DIR,DIRUT,DIROUT,DUOUT,DTOUT
38 ... ;W !
39 ... I $E(IOST,1,2)="C-" S DIR(0)="E" D ^DIR
40 ... I $D(DIRUT) S GMRCQT=1 Q
41 ... D HDR(.GMRCPAGE)
42 .. D PRTLOG(GMRCLOG,GMRCDA,GMRCACT)
43 .. Q
44 . Q
45 Q
46PRTLOG(LOG,CSLT,ACTVT) ;print the formatted entry
47 ;
48 ; Input:
49 ; LOG = ien from file 123.6
50 ; CSLT = ien from file 123 associated with LOG
51 ; ACTVT = activity within CSLT that is incomplete
52 ;
53 N GMRCMSG,GMRCPT,GMRCSSN,GMRCERR,GMRCDT
54 N GMRCFAC,GMRCSER,GMRCTRAN,GMRCLOG0,GMRCDTR
55 S GMRCLOG0=$G(^GMR(123.6,LOG,0)) I '$L(GMRCLOG0) Q
56 S GMRCDT=$$FMTE^XLFDT($P(GMRCLOG0,U),2)
57 S GMRCFAC=$$GET1^DIQ(4,$P(GMRCLOG0,U,2),.01)
58 S GMRCMSG=$P(GMRCLOG0,U,3)
59 S GMRCTRAN=$P(GMRCLOG0,U,7)
60 S GMRCERR=$$GET1^DIQ(123.6,LOG,.08)
61 S GMRCSER=$$GET1^DIQ(123,CSLT,1)
62 S GMRCPT=$$GET1^DIQ(123,CSLT,.02,"I")
63 S GMRCDTR=$$FMTE^XLFDT($$GET1^DIQ(123,CSLT,.01,"I"),2)
64 S GMRCSSN=$$GET1^DIQ(2,GMRCPT,.09)
65 S GMRCPT=$$GET1^DIQ(2,GMRCPT,.01)
66 W !!,?2,"Date/Time last transmitted: ",GMRCDT
67 W ?51,"Trans. attempts: ",GMRCTRAN
68 W !,?2,"Facility: ",GMRCFAC,?51,"Message: ",GMRCMSG
69 W !,?2,"Consult #: ",CSLT,?51,"Activity: ",ACTVT
70 W !,?2,"Patient name: ",GMRCPT,?51,"SSN: ",GMRCSSN
71 W !,?2,"Ordered Service: ",$E(GMRCSER,1,31),?51,"Req. date: ",GMRCDTR
72 W !,?2,"Error: ",GMRCERR
73 Q
74NOREC ; print the no records found message
75 W !,?5,"No incomplete IFC Transactions to report",!
76 Q
77HDR(PAGE) ; print the page hdr and increment page number
78 ;
79 W @IOF
80 W "Incomplete IFC Transaction Report"
81 W ?44,$$FMTE^XLFDT($$NOW^XLFDT),?69,"Page: ",PAGE
82 W !,$$REPEAT^XLFSTR("-",78)
83 S PAGE=PAGE+1
84 Q
Note: See TracBrowser for help on using the repository browser.