source: FOIAVistA/trunk/r/SCHEDULING-SD-SC/SCMCHLR3.m@ 1397

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

initial load of FOIAVistA 6/30/08 version

File size: 6.1 KB
Line 
1SCMCHLR3 ;ALB/KCL - PCMM HL7 Reject Processing - Build List Area con't; 10-JAN-2000
2 ;;5.3;Scheduling;**210,272**;AUG 13, 1993
3 ;
4BLDLIST(SCSORTBY,SCEPS,SCCNT) ; Description: Build list area for for PCMM Transmission errors.
5 ;
6 ; Input:
7 ; SCSORTBY - Sort by criteria
8 ; N -> Patient Name
9 ; D -> Date/Time Ack Received
10 ; P -> Provider
11 ; SCEPS - Error processing status
12 ;
13 ; Output:
14 ; SCCNT - Number of lines in the list
15 ;
16 N DFN,SCSUB,SCTEXT,SCTLIEN,SCERIEN,SCTLOG,SCHL
17 N SCPROV,SCTYPE,SCLINE,SCNUM,SCCOL,SCWID
18 ;
19 ;Init line counter and selection number
20 S (SCLINE,SCNUM)=0
21 ;
22 ;Quit if unable to determine col/width for caption flds in List Template
23 Q:'$$CAPFLD(.SCCOL,.SCWID)
24 ;
25 ;Loop thru sort array by pat name, OR date ack rec'd, OR provider
26 S SCSUB=$S(SCSORTBY="N":"",SCSORTBY="P":"",1:0)
27 F S SCSUB=$O(^TMP("SCERRSRT",$J,SCSORTBY,SCSUB)) Q:SCSUB="" D
28 .;loop through PCMM HL7 Transmission Log ien(s)
29 .S SCTLIEN=0
30 .F S SCTLIEN=$O(^TMP("SCERRSRT",$J,SCSORTBY,SCSUB,SCTLIEN)) Q:'SCTLIEN D
31 ..;loop through Error Code subfile ien(s)
32 ..S SCERIEN=0
33 ..F S SCERIEN=$O(^TMP("SCERRSRT",$J,SCSORTBY,SCSUB,SCTLIEN,SCERIEN)) Q:'SCERIEN D
34 ...;
35 ...;write dot to screen as list is being built (every 50 lines)
36 ...W:'(SCLINE#50) "."
37 ...;
38 ...;get data for PCMM HL7 Trans Log entry
39 ...I $$GETLOG^SCMCHLA(SCTLIEN,SCERIEN,.SCTLOG) D
40 ....;
41 ....;increment selection number
42 ....S SCNUM=SCNUM+1
43 ....;
44 ....;increment line counter
45 ....S SCLINE=SCLINE+1
46 ....;
47 ....;set selection number in display array
48 ....D SET(SCARY,SCLINE,SCNUM,SCCOL("NUM"),SCWID("NUM"),SCNUM,SCTLIEN,SCTLOG("DFN"),SCERIEN,.SCCNT)
49 ....;
50 ....;set retransmit flag in display array
51 ....S SCTEXT=$S($G(SCTLOG("STATUS"))="M":"*",1:" ")
52 ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("RET"),SCWID("RET"),SCNUM,,,,.SCCNT)
53 ....;set patient name in display array
54 ....S SCTEXT=$$LOWER^VALM1($S($G(SCTLOG("WORK")):"WORKLOAD",$G(SCTLOG("DFN")):$P($G(^DPT(SCTLOG("DFN"),0)),"^",1),1:"UNKNOWN"))
55 ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("PAT"),SCWID("PAT"),SCNUM,,,,.SCCNT)
56 ....;
57 ....;set patient id in display array
58 ....S DFN=+SCTLOG("DFN") D PID^VADPT
59 ....D SET(SCARY,SCLINE,VA("BID"),SCCOL("PATID"),SCWID("PATID"),SCNUM,,,,.SCCNT)
60 ....;
61 ....;set date ack received in display array
62 ....S SCTEXT=$$LOWER^VALM1($S($G(SCTLOG("ACK DT/TM")):$E($$FDATE^VALM1(SCTLOG("ACK DT/TM")),1,8),1:"UNKNOWN"))
63 ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("DTR"),SCWID("DTR"),SCNUM,,,,.SCCNT)
64 ....;
65 ....;set provider in display array
66 ....S SCPROV=""
67 ....K SCHL
68 ....;I workload get provider
69 ....I $G(SCTLOG("WORK")) S SCPROV=$$PROV^SCMCHLP(SCTLOG("WORK"))
70 ....;get provider if ZPC segment error
71 ....I $G(SCTLOG("ERR","SEG"))="ZPC" D
72 .....I $$GETHL7ID^SCMCHLA2($G(SCTLOG("ERR","ZPCID")),.SCHL)
73 .....S SCPTR=$P($G(SCHL("HL7ID")),"-",2)
74 .....S SCPROV=$P($G(^SCTM(404.52,+$G(SCPTR),0)),"^",3)
75 ....S SCTEXT=$$LOWER^VALM1($S($G(SCPROV)'="":$$EXTERNAL^DILFD(404.52,.03,,SCPROV),1:"N/A"))
76 ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("PROV"),SCWID("PROV"),SCNUM,,,,.SCCNT)
77 ....;
78 ....;set provider type in display array
79 ....S SCTYPE=$P($G(SCHL("HL7ID")),"-",4)
80 ....I $G(SCTLOG("WORK")) S SCTYPE="PC"
81 ....S SCTEXT=$S(SCTYPE'="":SCTYPE,1:"N/A")
82 ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("TYPE"),SCWID("TYPE"),SCNUM,,,,.SCCNT)
83 ....;
84 ....;set error processing status in display array
85 ....S SCTEXT=$$LOWER^VALM1($S($G(SCTLOG("ERR","EPS")):$$EXTERNAL^DILFD(404.47142,.06,,SCTLOG("ERR","EPS")),1:"UNKNOWN"))
86 ....D SET(SCARY,SCLINE,SCTEXT,SCCOL("STA"),SCWID("STA"),SCNUM,,,,.SCCNT)
87 ....;
88 ....;increment line counter
89 ....S SCLINE=SCLINE+1
90 ....;
91 ....;set error code/desc in display array
92 ....I $$GETEC^SCMCHLA2($G(SCTLOG("ERR","CODE")),.SCERR)
93 ....S SCTEXT="Error: "_$S($G(SCERR("CODE"))'="":SCERR("CODE")_" - "_$G(SCERR("SHORT")),1:$$LOWER^VALM1("UNKNOWN"))
94 ....K X S $P(X," ",160)=""
95 ....S SCTEXT=$E(SCTEXT_X,1,150)
96 ....D SET(SCARY,SCLINE,SCTEXT,10,$L(SCTEXT),SCNUM,,,,.SCCNT)
97 ;
98 Q
99 ;
100 ;
101SET(SCARY,SCLINE,SCTEXT,SCCOL,SCWID,SCNUM,SCTLIEN,SCDFN,SCERIEN,SCCNT) ;
102 ; Description: Set display array.
103 ;
104 ; Input:
105 ; SCARY - Global array subscript
106 ; SCLINE - Line number
107 ; SCTEXT - Text
108 ; SCCOL - Column to start at
109 ; SCWID - Column or text width
110 ; SCNUM - Selection number
111 ; SCTLIEN - PCMM HL7 Transmission Log IEN
112 ; SCERIEN - IEN of record in Error Code (#404.47142) multiple
113 ; SCDFN Patient IEN
114 ;
115 ; Output:
116 ; SCCNT - Number of lines in the list
117 ;
118 N X
119 S:SCLINE>SCCNT SCCNT=SCLINE
120 S X=$S($D(^TMP(SCARY,$J,SCLINE,0)):^(0),1:"")
121 S ^TMP(SCARY,$J,SCLINE,0)=$$SETSTR^VALM1(SCTEXT,X,SCCOL,SCWID)
122 S ^TMP(SCARY,$J,"IDX",SCLINE,SCNUM)=""
123 ;
124 ;Set special index used in retransmitting patient
125 I $G(SCTLIEN),$G(SCERIEN) D
126 .I '$G(SCTLOG("WORK")) Q:'SCDFN
127 .S ^TMP(SCARY_"IDX",$J,SCNUM)=SCLINE_"^"_SCTLIEN_"^"_SCERIEN
128 .S ^TMP(SCARY_"IDX",$J,"PT",$S(SCDFN:SCDFN,1:"W"),SCLINE)=SCTLIEN_"^"_SCERIEN
129 Q
130 ;
131 ;
132CAPFLD(SCCOL,SCWID) ; Description: Used to determine column/width of caption fields in the List Template.
133 ;
134 ; Input:
135 ; VALMDDF - Array available at run-time of list template. This array
136 ; is subscripted by caption field name of List Template.
137 ;
138 ; Output:
139 ; Function value: Returns 1 on success, 0 on failure
140 ; SCCOL - array subscripted by abbreviation of caption field name containing the column number where the data/caption starts, pass by reference
141 ; SCWID - array subscripted by abbreviation of caption field name containing the number of charaters the data/caption will use, pass by reference
142 ;
143 ;Quit if VALMDDF array is not defined
144 Q:'$D(VALMDDF) 0
145 ;
146 N X
147 S X=VALMDDF("NUMBER"),SCCOL("NUM")=$P(X,"^",2),SCWID("NUM")=$P(X,"^",3)
148 S X=VALMDDF("RETRANS"),SCCOL("RET")=$P(X,"^",2),SCWID("RET")=$P(X,"^",3)
149 S X=VALMDDF("PATIENT"),SCCOL("PAT")=$P(X,"^",2),SCWID("PAT")=$P(X,"^",3)
150 S X=VALMDDF("PATID"),SCCOL("PATID")=$P(X,"^",2),SCWID("PATID")=$P(X,"^",3)
151 S X=VALMDDF("DATE"),SCCOL("DTR")=$P(X,"^",2),SCWID("DTR")=$P(X,"^",3)
152 S X=VALMDDF("PROV"),SCCOL("PROV")=$P(X,"^",2),SCWID("PROV")=$P(X,"^",3)
153 S X=VALMDDF("TYPE"),SCCOL("TYPE")=$P(X,"^",2),SCWID("TYPE")=$P(X,"^",3)
154 S X=VALMDDF("STATUS"),SCCOL("STA")=$P(X,"^",2),SCWID("STA")=$P(X,"^",3)
155 Q 1
Note: See TracBrowser for help on using the repository browser.