source: FOIAVistA/trunk/r/TEXT_INTEGRATION_UTILITIES-GMRP-TIU/TIUELST.m@ 1713

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

initial load of FOIAVistA 6/30/08 version

File size: 6.0 KB
Line 
1TIUELST ; SLC/JER - Review Filer Events ;9/24/03
2 ;;1.0;TEXT INTEGRATION UTILITIES;**81,113**;Jun 20, 1997
3EN ; Invoke List Manager
4 D EN^VALM("TIU REVIEW FILING EVENTS")
5 S VALMBCK="Q"
6 Q
7MAKELIST ; Build review screen list
8 ; For Types 1;FILING ERRORS and
9 ; 2;MISSING FIELD ERRORS,
10 ;status is 0;UNRESOLVED or
11 ; 1;RESOLVED or
12 ; 2;UNRESOLVED/RESOLVED.
13 ; For Types 0;SUCCESSFUL FILING EVENTS and
14 ; 3;FILING EVENTS,
15 ;status is "".
16 N TIUI,TIUTMP,TYPE,STATUS,TIUK
17DIVISION ; Select Division(s)
18 D SELDIV^TIULA
19 I SELDIV'>0 S VALMQUIT=1 Q
20 I $D(TIUDI) D
21 . S TIUK=0 F S TIUK=$O(TIUDI(TIUK)) Q:'TIUK D
22 . . S TIUDI("ENTRIES")=$G(TIUDI("ENTRIES"))_TIUK_";"
23 E D
24 . S TIUDI("ENTRIES")="ALL DIVISIONS"
25 S TYPE=$$SELTYPE("FILING ERRORS")
26 I +TYPE=1 S STATUS=$$SELRES("UNRESOLVED") ; 1: Filing errors
27 I +TYPE=2 S STATUS=$$SELRES("UNRESOLVED") ; 2: Missing Field errors
28 I +TYPE=0 S STATUS="" ; 0: Successful filing events
29 I +TYPE=3 S STATUS="" ; 3: All filing events
30 I '$D(STATUS) S STATUS=""
31 I +$G(DIRUT) S VALMQUIT=1 Q
32 S TIUEDT=$$EDATE^TIULA("Event","T-30")
33 I TIUEDT'>0 S VALMQUIT=1 Q
34 S TIULDT=$$LDATE^TIULA("Event")
35 I TIULDT'>0 S VALMQUIT=1 Q
36 ; If TIUEDT is NOT earlier than TIULDT, then swap
37 I TIUEDT>TIULDT S TIUTMP=TIUEDT,TIUEDT=TIULDT,TIULDT=TIUTMP
38 W !,"Searching for the events."
39 D BUILD(TYPE,STATUS,TIUEDT,TIULDT,.TIUDI)
40 K TIUDI,SELDIV
41 Q
42SELTYPE(DFLT) ; Select Event Type
43 N PRMT,READTYPE,X,Y
44 S PRMT="Select Event Type: "
45 S READTYPE="SMA^F:Filing Errors;M:Missing Field Errors;S:Successes;A:All Events"
46 S Y=$P($$READ^TIUU(READTYPE,PRMT,DFLT),U)
47 S Y=$S(Y="S":"0;SUCCESSFUL FILING EVENTS",Y="F":"1;FILING ERRORS",Y="M":"2;MISSING FIELD ERRORS",1:"3;FILING EVENTS")
48 Q Y
49SELRES(DFLT) ; Select Resolution status
50 N PRMT,READTYPE,X,Y
51 S PRMT="Select Resolution Status: "
52 S READTYPE="SAM^U:Unresolved Errors;R:Resolved Errors;B:Both Unresolved and Resolved"
53 S Y=$P($$READ^TIUU(READTYPE,PRMT,DFLT),U)
54 S Y=$S(Y="U":"0;UNRESOLVED",Y="R":"1;RESOLVED",1:"2;UNRESOLVED/RESOLVED")
55 Q Y
56 ;
57BUILD(TIUTYP,STATUS,EARLY,LATE,DIVIFNS) ; Build List
58 N TIUCNT,TIUI,TIUJ,TIUK,TIUP,TIUPICK,TIUREC,TIUSTAT,XREF
59 S VALMCNT=0
60 K ^TMP("TIUERR",$J),^TMP("TIUERRIDX",$J)
61 S TIUPICK=+$O(^ORD(101,"B","TIU ACTION SELECT LIST ELEMENT",0))
62 I '$D(TIUPRM0)!'$D(TIUPRM0) D SETPARM^TIULE
63 ; For type 3 ALL events, get types 0 for SUCCESSFUL, 1 for FILING ERROR,
64 ;& 2 for MISSING FIELD ERROR. For other types, just get that type:
65 F TYPE=$S(+TIUTYP=3:0,1:+TIUTYP):1:$S(+TIUTYP=3:2,1:+TIUTYP) D
66 . S TIUI=0 F S TIUI=$O(^TIU(8925.4,"D",TYPE,TIUI)) Q:+TIUI'>0 D
67 . . I +$G(^TIU(8925.4,+TIUI,0))'<EARLY,(+$G(^(0))'>LATE) D
68 . . . ; If status is UNRESOLVED or RESOLVED, get only matching status;
69 . . . I STATUS'="",+STATUS'=2 Q:+STATUS'=$P($G(^TIU(8925.4,+TIUI,0)),U,6)
70 . . . I +$G(DIVIFNS("ENTRIES")),'$$ININST(+TIUI,.DIVIFNS) Q
71 . . . N DIC,DIQ,DA,DR,TIUERR,EDT,RDT,DTYPE,EDESC,USER,ETYPE,INST,INSTA,TIUSTN
72 . . . S DIQ="TIUERR",DIC=8925.4,DIQ(0)="IE",DA=TIUI
73 . . . S DR=".01:.09" D EN^DIQ1
74 . . . S USER=$$NAME^TIULS(TIUERR(8925.4,DA,.02,"E"),"LAST, FIRST")
75 . . . S EDT=$$DATE^TIULS(TIUERR(8925.4,DA,.01,"I"),"MM/DD/YY HR:MIN")
76 . . . S RDT=$$DATE^TIULS(TIUERR(8925.4,DA,.07,"I"),"MM/DD/YY HR:MIN")
77 . . . S DTYPE=TIUERR(8925.4,DA,.03,"E")
78 . . . S ETYPE=TIUERR(8925.4,DA,.08,"E"),EDESC=TIUERR(8925.4,DA,.04,"E")
79 . . . S INSTA="",INST=TIUERR(8925.4,DA,.09,"I")
80 . . . I INST D
81 . . . . S TIUSTN=$$NS^XUAF4(INST)
82 . . . . I $P(TIUSTN,U,2)]"" S INSTA=$P(TIUSTN,U,2)
83 . . . S INSTA=$E(INSTA,1,8)
84 . . . S TIUCNT=+$G(TIUCNT)+1
85 . . . S TIUREC=$$SETFLD^VALM1(TIUCNT,"","NUMBER")
86 . . . S TIUREC=$$SETFLD^VALM1(DTYPE,TIUREC,"DOCUMENT TYPE")
87 . . . S TIUREC=$$SETFLD^VALM1(ETYPE,TIUREC,"EVENT TYPE")
88 . . . S TIUREC=$$SETFLD^VALM1(EDT,TIUREC,"EVENT DATE/TIME")
89 . . . S TIUREC=$$SETFLD^VALM1(RDT,TIUREC,"RESOL DATE/TIME")
90 . . . S TIUREC=$$SETFLD^VALM1(USER,TIUREC,"USER NAME")
91 . . . S TIUREC=$$SETFLD^VALM1(INSTA,TIUREC,"DIVISION")
92 . . . S VALMCNT=+$G(VALMCNT)+1
93 . . . S ^TMP("TIUERR",$J,VALMCNT,0)=TIUREC
94 . . . S ^TMP("TIUERR",$J,"IDX",VALMCNT,TIUCNT)=""
95 . . . S ^TMP("TIUERR",$J,"PICK",TIUCNT,VALMCNT)=""
96 . . . D FLDCTRL^VALM10(VALMCNT,"NUMBER",IOINHI,IOINORM)
97 . . . S VALMCNT=+$G(VALMCNT)+1 W:VALMCNT#5'>0 "."
98 . . . S ^TMP("TIUERR",$J,VALMCNT,0)=$$SETFLD^VALM1(EDESC,"","DESCRIPTION")
99 . . . S ^TMP("TIUERR",$J,"IDX",VALMCNT,TIUCNT)=""
100 . . . S ^TMP("TIUERR",$J,"PICK",TIUCNT,VALMCNT)=""
101 . . . S ^TMP("TIUERRIDX",$J,TIUCNT)=VALMCNT_U_TIUI_U_$P(^TIU(8925.4,+TIUI,0),U,5)
102 ;
103 S ^TMP("TIUERR",$J,0)=+$G(TIUCNT)_U_TIUTYP_U_STATUS
104 S ^TMP("TIUERR",$J,"#")=TIUPICK_"^1:"_+$G(TIUCNT)
105 M ^TMP("TIUERR",$J,"DIV")=DIVIFNS
106 I $D(VALMHDR)>9 D HDR
107 I +$G(TIUCNT)'>0 D
108 . S ^TMP("TIUERR",$J,1,0)="",VALMCNT=2
109 . I +TIUTYP=1!(+TIUTYP=2) S STATUS=$$LOWER^TIULS($P(STATUS,";",2)),STATUS=STATUS_" "
110 . S ^TMP("TIUERR",$J,2,0)="No "_STATUS_$$LOWER^TIULS($P(TIUTYP,";",2))_" found within date/time range"
111 Q
112ININST(TIUI,TIUDI) ; Evaluates whether a TIU UPLOAD LOG record
113 ; is among the selected division(s)
114 ; Input -- TIUI TIU UPLOAD LOG file (#8925.4) IEN
115 ; -- TIUDI( i.e. TIUDI(file #40.8 IEN)=Institution file
116 ; pointer for file #40.8 entry
117 ; Output - TIUY 0= record not in selected division
118 ; 1= record in selected division
119 N TIUIFP,TIUJ,TIUINST,TIUY S TIUY=0
120 S TIUINST=+$P($G(^TIU(8925.4,+TIUI,0)),U,9)
121 S TIUJ=0 F S TIUJ=$O(TIUDI(TIUJ)) Q:'TIUJ!TIUY D
122 . S TIUIFP=$G(TIUDI(TIUJ))
123 . I TIUIFP=TIUINST S TIUY=1
124 Q TIUY
125HDR ; Initialize header for review screen
126 N BY,TIUX,SCREEN,STATUS,TITLE
127 S TIUX=$G(^TMP("TIUERR",$J,0))
128 ;TIU*1*81 status = 3rd, not 2nd piece of TIUX; hdr wrote UNRESOLVED instead of SUCCESSFUL
129 S TYPE=$P(TIUX,U,2),STATUS=$P(TIUX,U,3)
130 I +TYPE=0 S TITLE=$P(TYPE,";",2)
131 I +TYPE=1!(+TYPE=2) D
132 . S TITLE=$P(STATUS,";",2)
133 . S TITLE=TITLE_" "_$P(TYPE,";",2)
134 I +TYPE=3 S TITLE="ALL FILING EVENTS"
135 I '$D(TITLE) S TITLE=""
136 I +TIUEDT>1 S TITLE=TITLE_" from "_$$DATE^TIULS(TIUEDT,"MM/DD/YY")_" to "_$$DATE^TIULS(TIULDT,"MM/DD/YY")
137 S VALMHDR(1)=$$CENTER^TIULS(TITLE)
138 Q
139CLEAN ; Clean up your mess!
140 K ^TMP("TIUERR",$J),^TMP("TIUERRIDX",$J) D CLEAN^VALM10
141 K VALMY
142 Q
Note: See TracBrowser for help on using the repository browser.