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

BPSOSL.m

Go to the documentation of this file.
  1. BPSOSL ;BHAM ISC/FCS/DRS/DLF - Logging ;06/01/2004
  1. ;;1.0;E CLAIMS MGMT ENGINE;**1,5,10**;JUN 2004;Build 27
  1. ;;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ; Entry Points:
  1. ; LOG - Log a message
  1. ; LOG2CLM - Log a message to all transactions associated with a claim
  1. ; LOG2LIST - Log a message for all transactions in TRANLIST
  1. ; LOGARRAY - Log array data into the transaction
  1. ; LOGARAY2 - Log array data into all transactions associated with a claim
  1. ;
  1. ; SLOT is usually a BPS Transaction, but can also be a communication log
  1. ; The only communication log currently is for purging (format is DT+.5)
  1. ;
  1. ; LOG - Add an entry to BPS LOG
  1. ; Input
  1. ; SLOT - Slot to write message (required)
  1. ; TEXT - Message text (required)
  1. ; SPECIAL - Special processing (add date and/or time to TEXT
  1. ; If it contains a 'D', add Date
  1. ; If it contains a 'T', add time
  1. LOG(SLOT,TEXT,SPECIAL) ;
  1. ; Check parameters
  1. I $G(SLOT)="" Q
  1. I $G(TEXT)="" Q
  1. ;
  1. ; Do SPECIAL processing
  1. I $G(SPECIAL)]"",SPECIAL["D"!(SPECIAL["T") D
  1. . N %,%H,%I,X,Y D NOW^%DTC S Y=% X ^DD("DD")
  1. . I SPECIAL'["D" S Y=$P(Y,"@",2)
  1. . I SPECIAL'["T" S Y=$P(Y,"@")
  1. . S TEXT=TEXT_" - "_Y
  1. ;
  1. ; Initialize variables
  1. N FN,FDA,LOGIEN,IEN,MSG,NOW
  1. S FN=9002313.12,NOW=$$NOW^XLFDT()
  1. ;
  1. ; If SLOT not defined, create it and then check for errors
  1. S LOGIEN=$O(^BPS(FN,"B",SLOT,""))
  1. I 'LOGIEN D
  1. . S FDA(FN,"+1,",.01)=SLOT
  1. . D UPDATE^DIE("","FDA","IEN","MSG")
  1. . S LOGIEN=$G(IEN(1))
  1. I 'LOGIEN!$D(MSG) Q
  1. ;
  1. ; Update LAST UPDATE field
  1. K FDA,MSG
  1. S FDA(FN,LOGIEN_",",.02)=NOW
  1. D FILE^DIE("","FDA","MSG")
  1. I $D(MSG) Q
  1. ;
  1. ; Create the multiple
  1. K FDA
  1. S FN=9002313.1201
  1. S FDA(FN,"+1,"_LOGIEN_",",.01)=NOW
  1. S FDA(FN,"+1,"_LOGIEN_",",1)=$TR($E(TEXT,1,200),"^","~")
  1. D UPDATE^DIE("","FDA")
  1. Q
  1. ;
  1. ; LOG2CLM - Write MSG to log file for all BPS Transactions associated
  1. ; with the claim
  1. LOG2CLM(IEN02,MSG) ;
  1. N IEN59 S IEN59=0
  1. F S IEN59=$O(^BPST("AE",IEN02,IEN59)) Q:'IEN59 D LOG(IEN59,MSG)
  1. Q
  1. ;
  1. ; LOG2LIST - Write MSG to the log files of all in TRANLIST(*)
  1. ; Assumes TRANLIST exists
  1. LOG2LIST(MSG) ;
  1. N IEN59
  1. S IEN59=0
  1. F S IEN59=$O(TRANLIST(IEN59)) Q:'IEN59 D LOG(IEN59,MSG)
  1. Q
  1. ;
  1. ; LOGARRAY - Log an array
  1. LOGARRAY(SLOT,ROOT,MAX) ;
  1. N REF S REF=ROOT
  1. N COUNT S COUNT=0
  1. I '$D(MAX) S MAX=100
  1. I $D(@REF)#10'=1 S REF=$Q(@REF)
  1. F Q:REF="" D Q:'MAX
  1. . D LOG(SLOT,REF_"="_@REF)
  1. . S COUNT=COUNT+1
  1. . S REF=$Q(@REF)
  1. . S MAX=MAX-1
  1. I 'MAX,REF]"" D LOG(SLOT,"More of "_ROOT_" to log, but max reached")
  1. I 'COUNT D LOG(SLOT,"Nothing found in "_ROOT)
  1. Q
  1. ;
  1. ; LOGARAY2 - Log an array to the BPS Transactions associated with a claim
  1. LOGARAY2(IEN02,ROOT,MAX) ;
  1. N IEN59
  1. S IEN59=0
  1. F S IEN59=$O(^BPST("AE",IEN02,IEN59)) Q:'IEN59 D LOGARRAY(IEN59,ROOT,MAX)
  1. Q