source: WorldVistAEHR/trunk/r/MEDICINE-MC/MCESSCR.m@ 1211

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

initial load of WorldVistAEHR

File size: 3.1 KB
RevLine 
[613]1MCESSCR ;WISC/DCB-Sets up the screening for Electronic Signature ;6/26/96 12:51
2 ;;2.3;Medicine;;09/13/1996
3 ;
4PREEDIT(MCFILE) ; sets screen logic for edit
5 ;Sets up DIC("S") for editing
6 S:'$D(DIC("DR")) DIC("DR")="1"
7 Q $S($D(DIC("S")):DIC("S")_",$$SCREDIT^MCESSCR()",1:"I $$SCREDIT^MCESSCR()")
8 ;
9PREVIEW(MCFILE) ; sets screen logic for display and prints.
10 ;Sets up DIC("S") for display and printing
11 N MFD
12 S MFD=$D(MCESMFD),SUPV=$S($D(MCESSUP):1,1:0) K MCESSUP,MCESMFD
13 Q $S($D(DIC("S")):DIC("S")_",$$SCRPRT^MCESSCR(MCESKEY,"_MFD_","_SUPV_","_SUPV_")",1:"I $$SCRPRT^MCESSCR(MCESKEY,"_MFD_","_MCSUP_","_SUPV_")")
14 ;
15SCRPRT(KEY,MFD,SUP,SUPV) ; Screens out the records for printing.
16 ;Don't print if the record is mark for deletions
17 ;or the user don't have the key to display drafts
18 ;or the user has a key, he can display all reports
19 N TEMP,CODE,RMFD,MFD2
20 I MCFILE=691.5,$D(^MCAR(MCFILE,Y,"A")) Q 1
21 I '$D(^MCAR(MCFILE,Y,"ES")) Q 1
22 S TEMP=$G(^MCAR(MCFILE,Y,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),RMFD=+$P(TEMP,U,12)
23 I SUPV=1,(CODE'=8) Q 0
24 I SUPV=1,(CODE=8) Q 1
25 Q $S(RMFD:MFD,MFD=1:0,CODE=8:SUP,MCESSEC:1,CODE>2:1,1:0)
26 ;
27SCREDIT() ; Screens out the records for edits
28 ;Screens out reports that has been mark for deletion and superseded
29 ; For Key-Holder
30 N TEMP,CODE,MFD
31 S TEMP=$G(^MCAR(MCFILE,Y,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),TEMP=(MCESSEC&(CODE<8))
32 I MCFILE=691.5,'$D(^MCAR(MCFILE,Y,"ES")),$D(^MCAR(MCFILE,Y,"A")) Q 0
33 Q $S(MFD=1:0,CODE<3:1,TEMP:1,1:0)
34 ;
35SCRSUMPT(MCESKEY,REC,SUPV) ;Screen out the records for summary of patients
36 ; Screens out mark for deletion and draft reports if the user don't
37 ; have the key
38 N TEMP,CODE,MFD
39 I '$D(^MCAR(MCFILE,REC,"ES")) Q 1
40 S TEMP=$G(^MCAR(MCFILE,REC,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),MCESSEC=$D(^XUSEC(MCESKEY,DUZ))
41 Q $S(MFD=1:1,CODE=8:SUPV,MCESSEC:1,CODE>2:1,1:0)
42 ;
43SCRGI(MCFILE,REC,KEY,SUPV) ; Screens out records for reports for GI printed by fileman (THE RECALL LIST)
44 ; Screens out mark for deletion and draft reports, if the user don't
45 ; have the key.
46 N TEMP,CODE,MFD
47 S TEMP=$G(^MCAR(MCFILE,REC,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),TEMP=(MCESSEC&(CODE>2))
48 Q $S(MFD=1:1,CODE=8:SUPV,TEMP:1,1:0)
49SCRDEL(MCFILE,REC) ;Screen out for deleting drafts
50 N TEMP,CODE,MFD
51 S TEMP=$G(^MCAR(MCFILE,REC,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),TEMP=(CODE<3)
52 Q $S(MCESSEC:0,TEMP:1,1:0)
53ESTONUM(MCFILE,MCREC) ; Convert Release Code to Number
54 S TP=$P($G(^MCAR(MCFILE,MCREC,"ES")),U,7)
55 Q $$ESTONUM1(TP)
56ESTONUM1(TP) ; Convert a value to Release status
57 Q $S(TP="PD":2,TP="RV":3,TP="ROV":4,TP="RNV":5,TP="S":8,TP="SRV":6,TP="SROV":7,1:1)
58NUMTOES(TP) ;Convert number back to Release Code
59 ;Q $S(TP=2:"PD",TP=3:"RV",TP=4:"ROV",TP=5:"RNV",TP=6:"SRV",TP=7:"SRNV",TP=8:"S",1:"D")
60 Q $S(TP=2:"PD",TP=3:"RV",TP=4:"ROV",TP=5:"RNV",TP=6:"SRV",TP=7:"SROV",TP=8:"S",1:"D")
61ESRC(MCFILE,MCARGDA) ; Electronic Singature & Release Control
62 I $D(^MCAR(MCFILE,MCARGDA)),MCESON S UNSIGNED=$S($P($G(^MCAR(MCFILE,MCARGDA,"ES")),U,4)="":1,1:0) D POST^MCESEDT(MCFILE,.MCARGDA) D:UNSIGNED=1 ^MCWORKLD
63 Q
Note: See TracBrowser for help on using the repository browser.