- BPSOSL ;BHAM ISC/FCS/DRS/DLF - Logging ;06/01/2004
- ;;1.0;E CLAIMS MGMT ENGINE;**1,5,10**;JUN 2004;Build 27
- ;;Per VHA Directive 2004-038, this routine should not be modified.
- Q
- ; Entry Points:
- ; LOG - Log a message
- ; LOG2CLM - Log a message to all transactions associated with a claim
- ; LOG2LIST - Log a message for all transactions in TRANLIST
- ; LOGARRAY - Log array data into the transaction
- ; LOGARAY2 - Log array data into all transactions associated with a claim
- ;
- ; SLOT is usually a BPS Transaction, but can also be a communication log
- ; The only communication log currently is for purging (format is DT+.5)
- ;
- ; LOG - Add an entry to BPS LOG
- ; Input
- ; SLOT - Slot to write message (required)
- ; TEXT - Message text (required)
- ; SPECIAL - Special processing (add date and/or time to TEXT
- ; If it contains a 'D', add Date
- ; If it contains a 'T', add time
- LOG(SLOT,TEXT,SPECIAL) ;
- ; Check parameters
- I $G(SLOT)="" Q
- I $G(TEXT)="" Q
- ;
- ; Do SPECIAL processing
- I $G(SPECIAL)]"",SPECIAL["D"!(SPECIAL["T") D
- . N %,%H,%I,X,Y D NOW^%DTC S Y=% X ^DD("DD")
- . I SPECIAL'["D" S Y=$P(Y,"@",2)
- . I SPECIAL'["T" S Y=$P(Y,"@")
- . S TEXT=TEXT_" - "_Y
- ;
- ; Initialize variables
- N FN,FDA,LOGIEN,IEN,MSG,NOW
- S FN=9002313.12,NOW=$$NOW^XLFDT()
- ;
- ; If SLOT not defined, create it and then check for errors
- S LOGIEN=$O(^BPS(FN,"B",SLOT,""))
- I 'LOGIEN D
- . S FDA(FN,"+1,",.01)=SLOT
- . D UPDATE^DIE("","FDA","IEN","MSG")
- . S LOGIEN=$G(IEN(1))
- I 'LOGIEN!$D(MSG) Q
- ;
- ; Update LAST UPDATE field
- K FDA,MSG
- S FDA(FN,LOGIEN_",",.02)=NOW
- D FILE^DIE("","FDA","MSG")
- I $D(MSG) Q
- ;
- ; Create the multiple
- K FDA
- S FN=9002313.1201
- S FDA(FN,"+1,"_LOGIEN_",",.01)=NOW
- S FDA(FN,"+1,"_LOGIEN_",",1)=$TR($E(TEXT,1,200),"^","~")
- D UPDATE^DIE("","FDA")
- Q
- ;
- ; LOG2CLM - Write MSG to log file for all BPS Transactions associated
- ; with the claim
- LOG2CLM(IEN02,MSG) ;
- N IEN59 S IEN59=0
- F S IEN59=$O(^BPST("AE",IEN02,IEN59)) Q:'IEN59 D LOG(IEN59,MSG)
- Q
- ;
- ; LOG2LIST - Write MSG to the log files of all in TRANLIST(*)
- ; Assumes TRANLIST exists
- LOG2LIST(MSG) ;
- N IEN59
- S IEN59=0
- F S IEN59=$O(TRANLIST(IEN59)) Q:'IEN59 D LOG(IEN59,MSG)
- Q
- ;
- ; LOGARRAY - Log an array
- LOGARRAY(SLOT,ROOT,MAX) ;
- N REF S REF=ROOT
- N COUNT S COUNT=0
- I '$D(MAX) S MAX=100
- I $D(@REF)#10'=1 S REF=$Q(@REF)
- F Q:REF="" D Q:'MAX
- . D LOG(SLOT,REF_"="_@REF)
- . S COUNT=COUNT+1
- . S REF=$Q(@REF)
- . S MAX=MAX-1
- I 'MAX,REF]"" D LOG(SLOT,"More of "_ROOT_" to log, but max reached")
- I 'COUNT D LOG(SLOT,"Nothing found in "_ROOT)
- Q
- ;
- ; LOGARAY2 - Log an array to the BPS Transactions associated with a claim
- LOGARAY2(IEN02,ROOT,MAX) ;
- N IEN59
- S IEN59=0
- F S IEN59=$O(^BPST("AE",IEN02,IEN59)) Q:'IEN59 D LOGARRAY(IEN59,ROOT,MAX)
- Q
- --- Routine Detail --- with STRUCTURED ROUTINE LISTING ---[H[J[2J[HBPSOSL 2874 printed Dec 13, 2024@01:51:46 Page 2
- BPSOSL ;BHAM ISC/FCS/DRS/DLF - Logging ;06/01/2004
- +1 ;;1.0;E CLAIMS MGMT ENGINE;**1,5,10**;JUN 2004;Build 27
- +2 ;;Per VHA Directive 2004-038, this routine should not be modified.
- +3 QUIT
- +4 ; Entry Points:
- +5 ; LOG - Log a message
- +6 ; LOG2CLM - Log a message to all transactions associated with a claim
- +7 ; LOG2LIST - Log a message for all transactions in TRANLIST
- +8 ; LOGARRAY - Log array data into the transaction
- +9 ; LOGARAY2 - Log array data into all transactions associated with a claim
- +10 ;
- +11 ; SLOT is usually a BPS Transaction, but can also be a communication log
- +12 ; The only communication log currently is for purging (format is DT+.5)
- +13 ;
- +14 ; LOG - Add an entry to BPS LOG
- +15 ; Input
- +16 ; SLOT - Slot to write message (required)
- +17 ; TEXT - Message text (required)
- +18 ; SPECIAL - Special processing (add date and/or time to TEXT
- +19 ; If it contains a 'D', add Date
- +20 ; If it contains a 'T', add time
- LOG(SLOT,TEXT,SPECIAL) ;
- +1 ; Check parameters
- +2 IF $GET(SLOT)=""
- QUIT
- +3 IF $GET(TEXT)=""
- QUIT
- +4 ;
- +5 ; Do SPECIAL processing
- +6 IF $GET(SPECIAL)]""
- IF SPECIAL["D"!(SPECIAL["T")
- Begin DoDot:1
- +7 NEW %,%H,%I,X,Y
- DO NOW^%DTC
- SET Y=%
- XECUTE ^DD("DD")
- +8 IF SPECIAL'["D"
- SET Y=$PIECE(Y,"@",2)
- +9 IF SPECIAL'["T"
- SET Y=$PIECE(Y,"@")
- +10 SET TEXT=TEXT_" - "_Y
- End DoDot:1
- +11 ;
- +12 ; Initialize variables
- +13 NEW FN,FDA,LOGIEN,IEN,MSG,NOW
- +14 SET FN=9002313.12
- SET NOW=$$NOW^XLFDT()
- +15 ;
- +16 ; If SLOT not defined, create it and then check for errors
- +17 SET LOGIEN=$ORDER(^BPS(FN,"B",SLOT,""))
- +18 IF 'LOGIEN
- Begin DoDot:1
- +19 SET FDA(FN,"+1,",.01)=SLOT
- +20 DO UPDATE^DIE("","FDA","IEN","MSG")
- +21 SET LOGIEN=$GET(IEN(1))
- End DoDot:1
- +22 IF 'LOGIEN!$DATA(MSG)
- QUIT
- +23 ;
- +24 ; Update LAST UPDATE field
- +25 KILL FDA,MSG
- +26 SET FDA(FN,LOGIEN_",",.02)=NOW
- +27 DO FILE^DIE("","FDA","MSG")
- +28 IF $DATA(MSG)
- QUIT
- +29 ;
- +30 ; Create the multiple
- +31 KILL FDA
- +32 SET FN=9002313.1201
- +33 SET FDA(FN,"+1,"_LOGIEN_",",.01)=NOW
- +34 SET FDA(FN,"+1,"_LOGIEN_",",1)=$TRANSLATE($EXTRACT(TEXT,1,200),"^","~")
- +35 DO UPDATE^DIE("","FDA")
- +36 QUIT
- +37 ;
- +38 ; LOG2CLM - Write MSG to log file for all BPS Transactions associated
- +39 ; with the claim
- LOG2CLM(IEN02,MSG) ;
- +1 NEW IEN59
- SET IEN59=0
- +2 FOR
- SET IEN59=$ORDER(^BPST("AE",IEN02,IEN59))
- if 'IEN59
- QUIT
- DO LOG(IEN59,MSG)
- +3 QUIT
- +4 ;
- +5 ; LOG2LIST - Write MSG to the log files of all in TRANLIST(*)
- +6 ; Assumes TRANLIST exists
- LOG2LIST(MSG) ;
- +1 NEW IEN59
- +2 SET IEN59=0
- +3 FOR
- SET IEN59=$ORDER(TRANLIST(IEN59))
- if 'IEN59
- QUIT
- DO LOG(IEN59,MSG)
- +4 QUIT
- +5 ;
- +6 ; LOGARRAY - Log an array
- LOGARRAY(SLOT,ROOT,MAX) ;
- +1 NEW REF
- SET REF=ROOT
- +2 NEW COUNT
- SET COUNT=0
- +3 IF '$DATA(MAX)
- SET MAX=100
- +4 IF $DATA(@REF)#10'=1
- SET REF=$QUERY(@REF)
- +5 FOR
- if REF=""
- QUIT
- Begin DoDot:1
- +6 DO LOG(SLOT,REF_"="_@REF)
- +7 SET COUNT=COUNT+1
- +8 SET REF=$QUERY(@REF)
- +9 SET MAX=MAX-1
- End DoDot:1
- if 'MAX
- QUIT
- +10 IF 'MAX
- IF REF]""
- DO LOG(SLOT,"More of "_ROOT_" to log, but max reached")
- +11 IF 'COUNT
- DO LOG(SLOT,"Nothing found in "_ROOT)
- +12 QUIT
- +13 ;
- +14 ; LOGARAY2 - Log an array to the BPS Transactions associated with a claim
- LOGARAY2(IEN02,ROOT,MAX) ;
- +1 NEW IEN59
- +2 SET IEN59=0
- +3 FOR
- SET IEN59=$ORDER(^BPST("AE",IEN02,IEN59))
- if 'IEN59
- QUIT
- DO LOGARRAY(IEN59,ROOT,MAX)
- +4 QUIT