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