Home   Package List   Routine Alphabetical List   Global Alphabetical List   FileMan Files List   FileMan Sub-Files List   Package Component Lists   Package-Namespace Mapping  
Routine: MCESSCR

MCESSCR.m

Go to the documentation of this file.
  1. MCESSCR ;WISC/DCB-Sets up the screening for Electronic Signature ;6/26/96 12:51
  1. ;;2.3;Medicine;;09/13/1996
  1. ;
  1. PREEDIT(MCFILE) ; sets screen logic for edit
  1. ;Sets up DIC("S") for editing
  1. S:'$D(DIC("DR")) DIC("DR")="1"
  1. Q $S($D(DIC("S")):DIC("S")_",$$SCREDIT^MCESSCR()",1:"I $$SCREDIT^MCESSCR()")
  1. ;
  1. PREVIEW(MCFILE) ; sets screen logic for display and prints.
  1. ;Sets up DIC("S") for display and printing
  1. N MFD
  1. S MFD=$D(MCESMFD),SUPV=$S($D(MCESSUP):1,1:0) K MCESSUP,MCESMFD
  1. Q $S($D(DIC("S")):DIC("S")_",$$SCRPRT^MCESSCR(MCESKEY,"_MFD_","_SUPV_","_SUPV_")",1:"I $$SCRPRT^MCESSCR(MCESKEY,"_MFD_","_MCSUP_","_SUPV_")")
  1. ;
  1. SCRPRT(KEY,MFD,SUP,SUPV) ; Screens out the records for printing.
  1. ;Don't print if the record is mark for deletions
  1. ;or the user don't have the key to display drafts
  1. ;or the user has a key, he can display all reports
  1. N TEMP,CODE,RMFD,MFD2
  1. I MCFILE=691.5,$D(^MCAR(MCFILE,Y,"A")) Q 1
  1. I '$D(^MCAR(MCFILE,Y,"ES")) Q 1
  1. S TEMP=$G(^MCAR(MCFILE,Y,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),RMFD=+$P(TEMP,U,12)
  1. I SUPV=1,(CODE'=8) Q 0
  1. I SUPV=1,(CODE=8) Q 1
  1. Q $S(RMFD:MFD,MFD=1:0,CODE=8:SUP,MCESSEC:1,CODE>2:1,1:0)
  1. ;
  1. SCREDIT() ; Screens out the records for edits
  1. ;Screens out reports that has been mark for deletion and superseded
  1. ; For Key-Holder
  1. N TEMP,CODE,MFD
  1. S TEMP=$G(^MCAR(MCFILE,Y,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),TEMP=(MCESSEC&(CODE<8))
  1. I MCFILE=691.5,'$D(^MCAR(MCFILE,Y,"ES")),$D(^MCAR(MCFILE,Y,"A")) Q 0
  1. Q $S(MFD=1:0,CODE<3:1,TEMP:1,1:0)
  1. ;
  1. SCRSUMPT(MCESKEY,REC,SUPV) ;Screen out the records for summary of patients
  1. ; Screens out mark for deletion and draft reports if the user don't
  1. ; have the key
  1. N TEMP,CODE,MFD
  1. I '$D(^MCAR(MCFILE,REC,"ES")) Q 1
  1. S TEMP=$G(^MCAR(MCFILE,REC,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),MCESSEC=$D(^XUSEC(MCESKEY,DUZ))
  1. Q $S(MFD=1:1,CODE=8:SUPV,MCESSEC:1,CODE>2:1,1:0)
  1. ;
  1. SCRGI(MCFILE,REC,KEY,SUPV) ; Screens out records for reports for GI printed by fileman (THE RECALL LIST)
  1. ; Screens out mark for deletion and draft reports, if the user don't
  1. ; have the key.
  1. N TEMP,CODE,MFD
  1. S TEMP=$G(^MCAR(MCFILE,REC,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),TEMP=(MCESSEC&(CODE>2))
  1. Q $S(MFD=1:1,CODE=8:SUPV,TEMP:1,1:0)
  1. SCRDEL(MCFILE,REC) ;Screen out for deleting drafts
  1. N TEMP,CODE,MFD
  1. S TEMP=$G(^MCAR(MCFILE,REC,"ES")),CODE=$$ESTONUM1($P(TEMP,U,7)),MFD=+$P(TEMP,U,12),TEMP=(CODE<3)
  1. Q $S(MCESSEC:0,TEMP:1,1:0)
  1. ESTONUM(MCFILE,MCREC) ; Convert Release Code to Number
  1. S TP=$P($G(^MCAR(MCFILE,MCREC,"ES")),U,7)
  1. Q $$ESTONUM1(TP)
  1. ESTONUM1(TP) ; Convert a value to Release status
  1. 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)
  1. NUMTOES(TP) ;Convert number back to Release Code
  1. ;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")
  1. 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")
  1. ESRC(MCFILE,MCARGDA) ; Electronic Singature & Release Control
  1. 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
  1. Q