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

FBXCIPS.m

Go to the documentation of this file.
  1. FBXCIPS ;WIRMFO/SAB-POST INIT ;1/7/98
  1. ;;3.5;FEE BASIS;**11**;JAN 30, 1995
  1. ;
  1. N FBC,FBDA,FBDT,FBI,FBY
  1. D BMES^XPDUTL(" Examining FEE BASIS ID CARD AUDIT File data...")
  1. ; init variables
  1. S FBC("PAT","CHK")=0 ; count of patients checked
  1. S FBC("PAT","FIX")=0 ; count of patients fixed
  1. S FBC("AUD","CHK")=0 ; count of audit entries checked
  1. S FBC("AUD","FIX")=0 ; count of audit entries fixed
  1. S FBC("TOT")=$P($G(^FBAA(161.83,0)),U,4) ; number of patients to check
  1. S XPDIDTOT=FBC("TOT") ; set total for status bar
  1. S FBC("UPD")=5 ; initial % required to update status bar
  1. ;
  1. ; loop thru patients
  1. S FBDA=0 F S FBDA=$O(^FBAA(161.83,FBDA)) Q:'FBDA D
  1. . S FBC("PAT","CHK")=FBC("PAT","CHK")+1
  1. . S FBC("%")=FBC("PAT","CHK")*100/FBC("TOT") ; calculate % complete
  1. . ; check if status bar should be updated
  1. . I FBC("%")>FBC("UPD") D
  1. . . D UPDATE^XPDID(FBC("PAT","CHK")) ; update status bar
  1. . . S FBC("UPD")=FBC("UPD")+5 ; increase update criteria by 5%
  1. . ;
  1. . ; check header of multiple and correct if necessary
  1. . I +$P($G(^FBAA(161.83,FBDA,1,0)),U,2)'=161.831 D
  1. . . S FBC("PAT","FIX")=FBC("PAT","FIX")+1
  1. . . S $P(^FBAA(161.83,FBDA,1,0),U,2)="161.831DA"
  1. . . ;W !,"FH ",FBDA ; uncomment for testing
  1. . ;
  1. . ; loop thru audit multiple and correct any invalid entries
  1. . S FBI=0 F S FBI=$O(^FBAA(161.83,FBDA,1,FBI)) Q:'FBI D
  1. . . S FBC("AUD","CHK")=FBC("AUD","CHK")+1
  1. . . S FBDT=9999999.9999-FBI ; calculate date/time from FBI
  1. . . S FBY=$G(^FBAA(161.83,FBDA,1,FBI,0))
  1. . . ; compare #.01 field with calculated date/time
  1. . . I +$P(FBY,U)'=+FBDT D
  1. . . . S FBC("AUD","FIX")=FBC("AUD","FIX")+1
  1. . . . K ^FBAA(161.83,"B",FBDT,FBI) ; delete bad "B" x-ref
  1. . . . S ^FBAA(161.83,FBDA,1,FBI,0)=FBDT_U_$P(FBY,U)_"^Unknown^.5"
  1. . . . S:$P(FBY,U)]"" ^FBAA(161.83,"C",$P(FBY,U),FBDA,FBI)=""
  1. . . . ;W !," ",FBDA,?10,FBI,?25,FBY ; uncomment for testing
  1. ;
  1. S FBX=" "_FBC("PAT","CHK")_" header node"_$S(FBC("PAT","CHK")=1:" was",1:"s were")_" examined. "
  1. S FBX=FBX_$S(FBC("PAT","FIX")=0:"No problems were",FBC("PAT","FIX")=1:"1 problem was",1:FBC("PAT","FIX")_" problems were")_" found"_$S(FBC("PAT","FIX")>0:" and corrected",1:"")_"."
  1. D MES^XPDUTL(FBX)
  1. ;
  1. S FBX=" "_FBC("AUD","CHK")_" audit entr"_$S(FBC("AUD","CHK")=1:"y was",1:"ies were")_" examined. "
  1. S FBX=FBX_$S(FBC("AUD","FIX")=0:"No problems were",FBC("AUD","FIX")=1:"1 problem was",1:FBC("AUD","FIX")_" problems were")_" found"_$S(FBC("AUD","FIX")>0:" and corrected",1:"")_"."
  1. D MES^XPDUTL(FBX)
  1. ;
  1. Q
  1. ;FBXCIPS