source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCCVLOG1.m@ 1042

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

initial load of WorldVistAEHR

File size: 3.1 KB
RevLine 
[613]1SCCVLOG1 ;ALB/RMO,TMP - Scheduling Conversion Log Utilities - Error; [ 04/05/95 8:39 AM ]
2 ;;5.3;Scheduling;**211**;Aug 13, 1993
3 ;
4GETERR(SCERRNB,SCE,SCERRIP,SCLOG,SAVERR,SCERRMSG) ;Get error msg
5 ;Also log the error in the Scheduling conversion log file
6 ;if the conversion log IEN is passed in SCLOG.
7 ; Input -- SCERRNB Error number
8 ; SCE Array holding patient/date-tm/enctr/visit data
9 ; subscripts: "DFN"/"DATE"/"ENC"/"VSIT" [optional]
10 ; SCERRIP Error input parameter array [optional]
11 ; SCLOG Scheduling conversion log IEN [optional]
12 ; SAVERR Parameter that says whether or not to return the
13 ; error array or kill it (1=save it, 0=kill it)
14 ; Output -- SCERRMSG Error message array subscripted by line # of msg
15 D BLD^DIALOG(SCERRNB,.SCERRIP,"","SCERRMSG")
16 I $G(SCLOG) D LOGERR(SCLOG,.SCERRMSG,.SCE,.SCCVERRH) K:'$G(SAVERR) SCERRMSG
17 Q
18 ;
19LOGERR(SCLOG,SCERRMSG,SCE,SCCVERRH) ;Log the error in the CST file
20 ; Input -- SCLOG CST ien
21 ; -- SCERRMSG Error message array subscripted by line #
22 ; -- SCE Array holding patient/date-tm/enctr/visit data
23 ; subscripts: "DFN"/"DATE"/"ENC"/"VSIT"
24 ; I/O -- SCCVERRH Error counter, also output - pass by reference
25 ;
26 N SCDATA,SCERRM1,Z,Z0,Z1,SCCVH
27 ;
28 IF $G(SCCVERRH)="" N SCCVERRH S SCCVERRH=0
29 S SCCVERRH=SCCVERRH+1,SCERRMSG(.9)="ERROR #: "_SCCVERRH
30 ;
31 S (Z,Z0)=0
32 F S Z=$O(SCERRMSG(Z)) Q:'Z S Z1=$G(SCERRMSG(Z)) D
33 . Q:$S($TR(Z1," ")="":1,$E(Z1,1,7)="Calling":1,$E(Z1,1,6)="Source":1,$E(Z1,1,4)="User":1,$E(Z1,1,5)="Visit":1,$E(Z1,1,3)="TO:":1,$E(Z1,1,33)="ERROR MESSAGE FROM DATA2PCE^PXAPI":1,1:0)
34 . S Z0=Z0+1,SCERRM1(Z0,0)=$S(Z0>1:" ",1:"")_Z1
35 ;
36 I $L(SCERRM1(1,0))<210 S SCERRM1(1,0)=SCERRM1(1,0)_" - "_$$FMTE^XLFDT($$NOW^XLFDT,5)
37 ;
38 I $D(SCE) D
39 . S SCERRM1(Z0+1,0)=" Patient: ("_$G(SCE("DFN"))_") "_$$EXPAND^SCCVDSP2(409.68,.02,$G(SCE("DFN")))_" Enctr Dt: "_$$FMTE^XLFDT($G(SCE("DATE")),"5S")
40 . S SCERRM1(Z0+2,0)=" Enctr #: "_$G(SCE("ENC"))_" Visit #: "_$G(SCE("VSIT"))
41 . S SCERRM1(Z0+3,0)=" "
42 ;
43 I '$G(SCLOG) K SCERRMSG M SCERRMSG=SCERRM1
44 I $G(SCLOG) D
45 . M SCDATA("WP")=SCERRM1
46 . D WP^SCCVDBU(404.98,SCLOG,50,.SCDATA)
47 . ;
48 . S SCCVH(.07)=SCCVERRH-$G(SCCVERRT)
49 . D UPD^SCCVDBU(404.9825,+$$LSTREQ^SCCVLOG(SCLOG)_","_SCLOG,.SCCVH)
50 Q
51 ;
52CREATERR(DFN,SCDTM,SCOE,SCCVT,SCCLN,SCSC,SCLOG) ;
53 ; Create error log entry if add of visit or encounter fails
54 ; INPUT:
55 ; DFN == pt ien
56 ; SCDTM == encounter date/time
57 ; SCOE == encounter ien
58 ; SCCVT == origin of encounter (1-4)
59 ; SCCLN == ien of clinic
60 ; SCSC == stop code ien
61 ; SCLOG == ien of request log [optional]
62 N SCE,SCERRIP,SCERRMSG,Y
63 S SCERRIP(1)=$G(SCSC)
64 S SCERRIP(2)=$P($G(^DPT(DFN,0)),U)
65 S Y=SCDTM D D^DIQ S SCERRIP(3)=Y
66 S SCERRIP(4)=$P($G(^SC(SCCLN,0)),U)
67 S SCERRIP(5)=$S('SCOE:"Outpatient encounter",1:"Visit")
68 S SCERRIP(6)=$P("appointment^add/edit^disposition^credit stop",U,SCCVT)
69 S SCE("DFN")=DFN,SCE("ENC")=$G(SCOE),SCE("VSIT")="",SCE("DATE")=SCDTM
70 D GETERR(4049005.004,.SCE,.SCERRIP,$G(SCLOG),0,.SCERRMSG)
71 Q
72 ;
Note: See TracBrowser for help on using the repository browser.