source: WorldVistAEHR/trunk/r/SCHEDULING-SD-SC/SCENIA0.m@ 1133

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1SCENIA0 ;ALB/SCK - DISPLAY INCOMPLETE ENCOUNTER ERRORS ; 09-MAY-1997
2 ;;5.3;Scheduling;**66**;AUG 13, 1993
3 ;
4EN ; -- main entry point for SCENI INCOMPLETE ENC DISPLAY
5 ; Variables
6 ; SDOE - Ptr to #409.68
7 ; SDCLN - Ptr to #44
8 ; SDFLG - Deleted encounter or not
9 ; SCINF - Encounter information array
10 ;
11 N VALMCNT
12 S VALMBCK=""
13 K ^TMP("SCENI DFN",$J),^TMP("SCENI XMT",$J)
14 K VA,SDFLG
15 ;
16 Q:'+SDXPTR
17 S SDFLG=$$OPENC^SCUTIE1(SDXPTR,"SCINF")
18 ;
19 S DFN=SCINF("DFN")
20 S ^TMP("SCENI DFN",$J,0)=DFN
21 S ^TMP("SCENI XMT",$J,0)=+SDXPTR
22 D PID^VADPT6
23 D EN^VALM("SCENI INCOMPLETE ENC DISPLAY")
24 S VALMBCK="R"
25 Q
26 ;
27HDR ; -- header code
28 I '$G(VA("BID")) S DFN=SCINF("DFN") D PID^VADPT6
29 S VALMHDR(1)=" Patient: "_$$LOWER^VALM1($E($P(^DPT(SCINF("DFN"),0),U),1,25))
30 S VALMHDR(1)=$$SETSTR^VALM1("SSN: "_VA("BID"),VALMHDR(1),66,10)
31 S VALMHDR(2)=" Clinic: "_$E($P($G(^SC(SCINF("CLINIC"),0)),U),1,25)
32 S VALMHDR(2)=$$SETSTR^VALM1($S(SDFLG:"(DEL) ",1:" ")_"Encounter Date: "_$$FDTTM^VALM1(SCINF("ENCOUNTER")),VALMHDR(2),49,30)
33 Q
34 ;
35INIT ; -- init variables and list array
36 ; Variables
37 ; IW,IC,EC,EW,DC,DW,SC,SW - Col widths and positions
38 ; SDECNT - Counter
39 ;
40 K ^TMP("SCENI ERR",$J)
41 D CLEAN^VALM10
42 ;
43 S BL="",$P(BL," ",30)=""
44 S X=VALMDDF("INDEX"),IC=$P(X,U,2),IW=$P(X,U,3)
45 S X=VALMDDF("SOURCE"),SC=$P(X,U,2),SW=$P(X,U,3)
46 S X=VALMDDF("ERROR"),EC=$P(X,U,2),EW=$P(X,U,3)
47 S X=VALMDDF("DESCRIPTION"),DC=$P(X,U,2),DW=$P(X,U,3)
48 ;
49 D BLD
50 I '$D(^TMP("SCENI ERR",$J)) D Q
51 . S (SDECNT,VALMCNT)=0
52 . D SET(" "),SET("No Errors found.")
53 Q
54 ;
55BLD ; Build display global for error entries in the error file
56 ;
57 S (SDECNT,VALMCNT)=0,SDEPTR=""
58 F S SDEPTR=$O(^SD(409.75,"B",SDXPTR,SDEPTR)) Q:'SDEPTR D
59 . Q:'$D(^SD(409.75,SDEPTR))
60 . D BLD1(SDEPTR)
61 Q
62 ;
63BLD1(SDEPTR) ; Build display line
64 ; Input
65 ; SDEPTR - Ptr to #409.75
66 ;
67 ; Variables
68 ; SDX - Local variable
69 ; ERNODE - Error table node 0
70 ; ERNODE1 - Error table node 1
71 ; SDERR - Error code
72 ;
73 N SDSRC
74 ;
75 S SDECNT=SDECNT+1,SDX="",$P(SDX," ",VALMWD+1)=""
76 ;W:(SDECNT#10)=0 "."
77 ;
78 S SDERR=$P(^SD(409.75,SDEPTR,0),U,2)
79 Q:'SDERR
80 S ERNODE=$G(^SD(409.76,SDERR,0))
81 S ERNODE1=$G(^SD(409.76,SDERR,1))
82 ;
83 S SDX=$E(SDX,1,IC-1)_$E(SDECNT_BL,1,IW)_$E(SDX,IC+IW+1,VALMWD)
84 S SDSRC=$P(ERNODE,U,2)
85 S SDX=$E(SDX,1,SC-1)_$E($S(SDSRC="V":"VISTA",SDSRC="N":"NPCD ",1:"UNK ")_BL,1,SW)_$E(SDX,SC+SW+1,VALMWD)
86 S SDX=$E(SDX,1,EC-1)_$E($P(ERNODE,U)_BL,1,EW)_$E(SDX,EC+EW+1,VALMWD)
87 S SDX=$E(SDX,1,DC-1)_$E(ERNODE1_BL,1,DW)_$E(SDX,DC+DW+1,VALMWD)
88 D SET(SDX)
89 Q
90 ;
91SET(X) ; Sets formatted display string into TMP global
92 S VALMCNT=VALMCNT+1,^TMP("SCENI ERR",$J,VALMCNT,0)=X
93 Q:'SDECNT
94 S ^TMP("SCENI ERR",$J,"IDX",VALMCNT,SDECNT)=SDEPTR_U_$P(ERNODE,U)
95 S ^TMP("SCENI ERR",$J,"DA",SDECNT,SDEPTR)=""
96 ;S ^TMP("SCENI ERR",$J,"XMT",SDECNT,SDXPTR)=""
97 Q
98 ;
99HELP ; -- help code
100 S X="?" D DISP^XQORM1 W !!
101 Q
102 ;
103EXIT ; -- exit code
104 K ^TMP("SCENI ERR",$J),^TMP("SCENI DFN",$J),^TMP("SCENI XMT",$J),VA
105 K BL,IW,IC,EC,EW,DC,DW,SC,SW,SDECNT,SCINF,SDFLG,SDEPTR,SDX,ERNODE,ERNODE1,SDERR,SCCOR,SCTEXT
106 K SDN1,SDN2,SCEPTR,SDOK,SINDX,DIE,DR,STATUS,RESULT
107 I $G(FLG1),$D(VALMBCK),VALMBCK="R" D REFRESH^VALM S VALMBCK=$P(VALMBCK,"R")_$P(VALMBCK,"R",2)
108 Q
Note: See TracBrowser for help on using the repository browser.