source: WorldVistAEHR/trunk/r/HEALTH_LEVEL_SEVEN-HL/HLCSRPT5.m@ 1259

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

initial load of WorldVistAEHR

File size: 3.4 KB
Line 
1HLCSRPT5 ;OIFO-O/LJA - Error Listing code ;3/18/02 10:19
2 ;;1.6;HEALTH LEVEL SEVEN;**85**;Oct 13, 1995
3 ;
4ERRRPT ; Format a report line (Moved here by HL*1.6*85 from HLCSRPT2)
5 N PROCDT ;HL*1.6*85
6 S HLCSY=""
7 S HLCSRNO=HLCSJ,SPACE20=" "
8 I VERS22'="" D
9 .S HLCSRNO="$.%$CREF$^TMP($J,""MESSAGE"","_HLCSRNO_")$CREF$^"_HLCSRNO_"$.%"
10 .S Y=$L(HLCSJ),X=$E(SPACE20,1,13-Y) S HLCSRNO=HLCSRNO_X K X,Y ;HL*1.6*85
11 E S HLCSRNO=HLCSRNO_SPACE20 S HLCSRNO=$E(HLCSRNO,1,13) ;HL*1.6*85
12 S HLCSY=HLCSRNO_" "
13 ;
14 ; Major HL*1.6*85 modifications begin here (to print date/time)
15 ; Just add Processed Date/Time to message ID field cow bird fashion
16 S HLCSMX=$P(HLCSX,U,2)
17 N PROCDT
18 S PROCDT=$$PROCDT(+HLCSJ)
19 S PROCDT=$$DTORTM(ERRDTB,ERRDTE,PROCDT)
20 S PROCDT=$S(PROCDT]"":PROCDT,1:" ") ; Can't be null!! (subscript error)
21 I $L(HLCSMX)<17 D
22 . S HLCSMX=$E(HLCSMX_SPACE20,1,16)_" "_PROCDT
23 S HLCSMID=HLCSMX_SPACE25 S HLCSMID=$E(HLCSMID,1,25)_" "
24 ;End HL*1.6*85 modifications
25 ;
26 S HLCSPTR=$P(^HLMA(HLCSJ,0),"^",1)
27 S HLCSY=HLCSY_HLCSMID_" "
28 S HLCSY=HLCSY_$E(HLCSLNK_SPACE20,1,10)_" "
29 S HLCSY=HLCSY_HLCSEVN_" "
30 S HLCSTYP=$P(HLCSX,U,3) S:HLCSTYP="O" HLCSTYP="OT" S:HLCSTYP="I" HLCSTYP="IN"
31 S HLCSY=HLCSY_$E(HLCSTYP_SPACE20,1,2)_" "
32 S HLCSSRVR=$P(HLCSX,U,11) I HLCSSRVR'="",($D(^HL(771,HLCSSRVR,0))) S HLCSSRVR=$P(^HL(771,HLCSSRVR,0),U,1)
33 S HLCSY=HLCSY_$E(HLCSSRVR_SPACE20,1,8)_" "
34 S HLCSCLNT=$P(HLCSX,U,12) I HLCSCLNT'="",($D(^HL(771,HLCSCLNT,0))) S HLCSCLNT=$P(^HL(771,HLCSCLNT,0),U,1)
35 S HLCSY=HLCSY_$E(HLCSCLNT_SPACE20,1,8)
36 S HLCSER1=HLCSER1_SPACE80,HLCSER1=$E(HLCSER1,1,39)_" "
37 S HLCSERMS=HLCSERMS_SPACE80,HLCSERMS=$E(HLCSERMS,1,39)
38 S HLCSLN=HLCSLN+1
39 I VERS22="" S HLCSY=HLCSY_" "_HLCSER1_HLCSERMS
40 D INFO ;HL*1.6*85
41 S ^TMP("TMPLOG",$J,PROCDT,+HLCSJ)=HLCSY
42 I VERS22'="" S ^TMP($J,"MESSAGE",HLCSJ)="$XC$^D VERS22^HLCSRPT2("_HLCSJ_","_HLCSPTR_")$XC$^MESSAGE"
43 Q
44 ;
45PROCDT(IEN773) ; Return 773'S processing date (1st), or if not available
46 ; return the 772 creation date/time. ;HL*1.6*85
47 N PROCDT
48 S PROCDT=$P($G(^HLMA(+IEN773,"S")),U) QUIT:PROCDT?7N.E PROCDT ;->
49 QUIT $P($G(^HL(772,+$G(^HLMA(+IEN773,0)),0)),U)
50 ;
51DTORTM(DTB,DTE,PDT) ; Show date or time?
52 QUIT $S($E(DTB,1,7)=$E(DTE,1,7):$$TM(PDT),1:$$DT(PDT))
53 ;
54TM(PDT) ; Show the 5 character hh:mm time
55 QUIT $E($P($$FMTE^XLFDT(+PDT),"@",2),1,5)
56 ;
57DT(PDT) ; Show the 8 character mm/dd/yy date
58 QUIT $E(PDT,4,5)_"/"_$E(PDT,6,7)_"/"_$E(PDT,2,3)
59 ;
60INFO ; If TYPEINFO=Error Type, reset HLCSY. (Called from ERRRPT^HLCSRPT4) - HL*1.6*85
61 ; HLCSJ,HLCSRNO -- req
62 N DATA,ET,ETYPE,I7717
63 QUIT:TYPEINFO'=2 ;->
64 S DATA=$P(HLCSY,HLCSRNO_" ",2,99) QUIT:DATA']"" ;->
65 S I7717=$P($G(^HLMA(+HLCSJ,"P")),U,4)
66 S ETYPE=$P($G(^HL(771.7,+I7717,0)),U)
67 I ETYPE="Duplicate Message" D
68 . S ET=$P(^HLMA(+HLCSJ,"P"),U,3) ; Free text
69 . QUIT:ET'["Duplicate with ien" ;->
70 . S ET=$P(ET,"Duplicate with ien ",2) QUIT:ET'?1.N ;->
71 . S ETYPE="Duplicate w/# "_ET
72 I ETYPE="Incorrect Message Received" D
73 . S ET=$P(^HLMA(+HLCSJ,"P"),U,3) ; Free text
74 . QUIT:ET'["Incorrect msg. Id" ;->
75 . S ETYPE="Incorrect message ID"
76 S $E(DATA,39,999)=$E(ETYPE_SPACE80,1,41)
77 S HLCSY=HLCSRNO_" "_DATA
78 QUIT
79 ;
80MSGEVN(IEN773,PCE) ; Return MSG~EVN piece (PCE)...
81 N DEL,MSGEVN,MSH
82 S MSH=$G(^HLMA(+IEN773,"MSH",1,0)) QUIT:MSH']"" " " ;->
83 S DEL=$E(MSH,4) QUIT:DEL']"" " " ;->
84 S MSGEVN=$P(MSH,DEL,9) QUIT:MSGEVN'?1.E1"~"1.E " " ;->
85 QUIT $P(MSGEVN,"~",+PCE)
86 ;
87EOR ;HLCSRPT5 - Error Listing code ;3/18/02 10:19
Note: See TracBrowser for help on using the repository browser.