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

MCESEDT2.m

Go to the documentation of this file.
  1. MCESEDT2 ;WISC/DCB-ELECTRONIC SIGNATURE EDITS PART 2 ;6/26/96 12:51
  1. ;;2.3;Medicine;;09/13/1996
  1. EDD ; Draft
  1. EDPD ; Problem Draft
  1. S TEMP=DUZ_U_U_$$NOW(1)_"^^^^"_$$NUMTOES^MCESSCR(LOOP)_"^^^^^^^"
  1. S:$P($G(^MCAR(MCFILE,REC,"ES")),U,14)="" TEMP=TEMP_"^"_$$NOW(1)
  1. Q
  1. EDRV ; Release On-line Verify
  1. D SIGN Q:ERROR=1
  1. S $P(TEMP,U,4)=DUZ,$P(TEMP,U,6)=$$NOW(1),$P(TEMP,U,8)=$$NOW(1),$P(TEMP,U,9)=$$NOW(1),$P(TEMP,U,2)="",$P(TEMP,U,3)="",$P(TEMP,U,5)=SCRAMBLE
  1. Q
  1. EDROV ; Release Off-Line Verify
  1. D SIGN Q:ERROR=1
  1. S DIR(0)="E",DIR("T")=30 D ^DIR K DIR,DIRUT,DTOUT,DIROUT
  1. I $D(DUOUT) S TEMP=ORG,EXIT=1 K DUOUT Q
  1. D HEADER^MCESEDT
  1. W !!,IOBON,"Please enter a provider that you are signing for",IOBOFF
  1. W !,"Note: This provider must have a key for ",IOUON,MCROUT,IOUOFF,!
  1. S DIC=200,DIC(0)="AEQMZ"
  1. S DIC("A")="Please select a Provider with a "_IOINHI_MCROUT_IOINORM_" key: "
  1. S DIC("S")="I $D(^XUSEC(MCESKEY,Y)),(Y'=DUZ)" D ^DIC K DIC
  1. S CDUZ=+Y
  1. I $D(DUOUT)!($D(DTOUT))!(CDUZ<0) S EXIT=1,TEMP=ORG D:$G(SUP)="S" DELSS^MCESEDT Q
  1. S $P(TEMP,U,1)=DUZ,$P(TEMP,U,3)=$$NOW(1),$P(TEMP,U,8)=$$NOW(1),$P(TEMP,U,9)=$$NOW(1),$P(TEMP,U,4)=CDUZ,$P(TEMP,U,2)=SCRAMBLE
  1. Q
  1. SIGN ; Display message, checks for elect. sign
  1. I $P($G(^VA(200,DUZ,20)),U,4)="" D ERROR S ERROR=1 Q
  1. W !!,"In order to "_IOUON_"release and verify"_IOUOFF_" procedure results",!,"you must type in your electronic signature code."
  1. D SIG^XUSESIG S:X1="" ERROR=1
  1. I ERROR=1 D HEADER^MCESEDT,ERROR Q
  1. S SCRAMBLE=$$ENCODE^MCESPRT(MCFILE,MCARGDA)
  1. Q
  1. EDRNV ; Release Not Verify
  1. I NCHANGE G EDRNV1
  1. W !!,IOINHI,IOBON,*7,"This option should be used with extreme CAUTION.",IOINORM,IOBOFF
  1. W !,"You can be held accountable for releasing unverified procedure results",!!
  1. S DIR(0)="Y",DIR("B")="N",DIR("A")="Do you "_IOUON_"still"_IOUOFF_" want to countinue" D ^DIR K DIR
  1. I Y=0!$D(DIRUT) S EXIT=1 Q
  1. EDRNV1 ;
  1. W !!
  1. S DIR("B")="NO",DIR(0)="Y"
  1. S DIR("A",1)="Since this record is "_IOUON_"Released Not Verified"_IOUOFF
  1. S DIR("A")="Do you want to mark this record for deletion"
  1. S DIR("?",1)="When you "_IOUON_"mark a record for deletion"_IOUOFF_","
  1. S DIR("?",2)="the record will be gone from your view and everyone else's"
  1. S DIR("?",3)="view with the exception of the manager of "_IOUON_MCROUT_IOUOFF_"."
  1. S DIR("?")="YES: Mark it for deletion NO: Don't mark it for deletion"
  1. D ^DIR K DIR I $D(DIRUT) S EXIT=1 Q
  1. I Y=1 S $P(TEMP,U,12)="1",$P(TEMP,U,13)=DUZ,$P(TEMP,U,3)=$$NOW(1)
  1. I NCHANGE=0 S $P(TEMP,U,8)=$$NOW(1),$P(TEMP,U,9)="",$P(TEMP,U,1)=DUZ,$P(TEMP,U,3)=$$NOW(1)
  1. Q
  1. EDS ; Superseded
  1. S MCESTEMP=ORG
  1. W !!!,"You must sign a Superseded record in order to complete the process"
  1. S DIR(0)="Y",DIR("B")="NO",DIR("A")="Do you "_IOUON_"still"_IOUOFF_" want to countinue" D ^DIR K DIR
  1. I Y=0!(Y=U)!(Y="") S EXIT=1 K MCBACK Q
  1. S (X,MX)=$P(^MCAR(MCFILE,REC,0),U,1)
  1. S NOW=$$NOW(X)
  1. S PDATE=+$P(TEMP,U,15)
  1. W !!,?14,IOBON,IODWL,IOUON,"Please Wait!",IOBOFF,IOUOFF
  1. K DD,DO,DIC S HOLD="^MCAR("_MCFILE_",",DIC=HOLD,X=$P(^MCAR(MCFILE,REC,0),U,1),DIC(0)=""
  1. D FILE^DICN S NEWREC=+Y
  1. I +Y=-1 W !!,IOINHI,"An ",IOBON,"error",IOBOFF," has occured",!,"in creating the new record" S EXIT=1 Q
  1. W !!,"Record "_REC_" copy to "_NEWREC_"."
  1. S %X=HOLD_REC_",",%Y=HOLD_NEWREC_"," D %XY^%RCR
  1. S ^MCAR(MCFILE,NEWREC,"ES")=DUZ_U_U_NOW_U_U_U_U_"D"_U_U_U_REC_U_U_U_U_PDATE_U_NOW
  1. W !,"Indexing "_NEWREC_"." S DIK=HOLD,DA=NEWREC D IX^DIK K DIK
  1. S $P(TEMP,U,11)=NEWREC,$P(TEMP,U,3)=NOW
  1. S $P(TEMP,U,1)=DUZ,$P(TEMP,U,3)=NOW,$P(TEMP,U,8)=NOW,$P(TEMP,U,9)=NOW
  1. W !!,"Your Procedure has been Copied",!,"You can now make changes to the copy."
  1. W !,"New Record:",!
  1. S DIC="^MCAR("_MCFILE_",",DIC(0)="EMQZ",X=" " D ^DIC K DIC
  1. S MCY=Y,MCY(0)=Y(0),MCY(0,0)=Y(0,0)
  1. S MCESPREV=REC,MCESCUR=NEWREC,MCBACK=1
  1. S $P(^MCAR(MCFILE,NEWREC,"ES"),U,16)=+$P(TEMP,U,16)+1
  1. K PDATE,NOW,TY,X,DTOUT,DUOUT,DIROUT
  1. Q
  1. EDSRV ; NO
  1. EDSROV ; OP
  1. Q
  1. ERROR ;
  1. K NEWST ;D HEADER^MCESEDT
  1. W !!,IOINHI,IOBON,*7,"Your electronic signature is invalid or not declared.",IOINORM,IOBOFF
  1. W !!,"You must declare an electronic signature or ask your IRM for help."
  1. W !,"===> No changes to release status can be done. <===="
  1. S TEMP=ORG,ERROR=1,EXIT=1
  1. Q
  1. ASK ;
  1. S DIR("A")=IOINHI_"Please Select a New Status"_IOINORM
  1. D ^DIR I $D(DIRUT) S EXIT=1
  1. I Y=DIR("B"),(PROV>2) S EXIT=1
  1. K DIR Q:EXIT=1
  1. S NEWST=Y(0) D HEADER^MCESEDT Q
  1. NOW(TA) ;
  1. D NOW^%DTC Q $E(%,1,12)
  1. Q