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

FSCAUDIT.m

Go to the documentation of this file.
  1. FSCAUDIT ;SLC/STAFF-NOIS Audit ;9/6/98 20:28
  1. ;;1.1;NOIS;;Sep 06, 1998
  1. ;
  1. AUDIT(CALL,OLDV,NEWV) ; from FSCLMPE1, FSCRPCEB, FSCRPCEC, FSCRPCW
  1. ; Call is the internal entry number from 7100
  1. ; OLDV will be a subscripted variable OLDV(DATENAME)=VALUE
  1. ; NEWV will be a subscripted variable NEWV(DATENAME)=VALUE
  1. ;
  1. I '$G(CALL) Q
  1. N ABBREV,CNT,LASTLINE,OK,STR K STR
  1. S CNT=0,ABBREV="" F S ABBREV=$O(OLDV(ABBREV)) Q:ABBREV="" D
  1. .I OLDV(ABBREV)'=NEWV(ABBREV) D
  1. ..I 'CNT S CNT=CNT+1,STR(CNT)="*** "_$$FMTE^XLFDT($$NOW^XLFDT)_" "_$$VALUE^FSCGET(DUZ,7100,5)
  1. ..S CNT=CNT+1
  1. ..I ABBREV="SUBJECT" S STR(CNT)=$P($G(^FSC("FLD",+$O(^FSC("FLD","AC",ABBREV,0)),0)),U)_": changed from "_OLDV(ABBREV)_" to "_NEWV(ABBREV) Q ; treated separate because no 2nd piece since '^' is allowed in value
  1. ..S STR(CNT)=$P($G(^FSC("FLD",+$O(^FSC("FLD","AC",ABBREV,0)),0)),U)_": changed from "
  1. ..I $L(STR(CNT))+$L($P(OLDV(ABBREV),U,2))+4<245 S STR(CNT)=STR(CNT)_$P(OLDV(ABBREV),U,2)_" to "
  1. ..E S CNT=CNT+1,STR(CNT)=$P(OLDV(ABBREV),U,2)_" to "
  1. ..I $L(STR(CNT))+$L($P(NEWV(ABBREV),U,2))<245 S STR(CNT)=STR(CNT)_$P(NEWV(ABBREV),U,2)
  1. ..E S CNT=CNT+1,STR(CNT)=$P(NEWV(ABBREV),U,2)
  1. I CNT D I 'OK Q
  1. .S OK=1
  1. .S CNT=CNT+1,STR(CNT)="" ; add an extra line
  1. .L +^FSCD("CALL",CALL):30 I '$T S OK=0 Q
  1. .S LASTLINE=+$O(^FSCD("CALL",CALL,100,"A"),-1)
  1. .S CNT=0 F S CNT=$O(STR(CNT)) Q:CNT<1 D
  1. ..S LASTLINE=LASTLINE+1
  1. ..S ^FSCD("CALL",CALL,100,LASTLINE,0)=STR(CNT)
  1. .S ^FSCD("CALL",CALL,100,0)="^^"_LASTLINE_U_LASTLINE_U_DT_U
  1. .L -^FSCD("CALL",CALL)
  1. D UPDATE(CALL)
  1. K STR
  1. Q
  1. ;
  1. DESC(CALL,OLDV,NEWV) ; from FSCLMPE1, FSCRPCEC, FSCRPCEF
  1. I '$G(CALL) Q
  1. N ABBREV,CNT,LASTLINE,OK,STR K STR
  1. S CNT=0,ABBREV="" F S ABBREV=$O(OLDV(ABBREV)) Q:ABBREV="" D
  1. .I OLDV(ABBREV)'=NEWV(ABBREV) D
  1. ..I 'CNT S CNT=CNT+1,STR(CNT)="*** "_$$FMTE^XLFDT($$NOW^XLFDT)_" "_$$VALUE^FSCGET(DUZ,7100,5)
  1. ..S CNT=CNT+1
  1. ..S STR(CNT)=$P($G(^FSC("FLD",+$O(^FSC("FLD","AC",ABBREV,0)),0)),U)_": edited."
  1. I CNT D I 'OK Q
  1. .S OK=1
  1. .S CNT=CNT+1,STR(CNT)="" ; add an extra line
  1. .L +^FSCD("CALL",CALL):30 I '$T S OK=0 Q
  1. .S LASTLINE=+$O(^FSCD("CALL",CALL,100,"A"),-1)
  1. .S CNT=0 F S CNT=$O(STR(CNT)) Q:CNT<1 D
  1. ..S LASTLINE=LASTLINE+1
  1. ..S ^FSCD("CALL",CALL,100,LASTLINE,0)=STR(CNT)
  1. .S ^FSCD("CALL",CALL,100,0)="^^"_LASTLINE_U_LASTLINE_U_DT_U
  1. .L -^FSCD("CALL",CALL)
  1. D UPDATE(CALL)
  1. K STR
  1. Q
  1. ;
  1. UPDATE(DA) ; from FSCEB, FSCEU, FSCRPCEB, FSCRPCEC, FSCRPCEN, FSCRPCF
  1. N DIE,DR
  1. S DIE="^FSCD(""CALL"",",DR="123///NOW;124///`"_DUZ
  1. L +^FSCD("CALL",CALL):30 I '$T Q ; *** needs ok
  1. D ^DIE
  1. L -^FSCD("CALL",CALL)
  1. Q