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

IB20P361.m

Go to the documentation of this file.
  1. IB20P361 ;BP/TJH - Preinit routine for IB*2.0*361 ; 12/14/2006
  1. ;;2.0;INTEGRATED BILLING;**361**;21-MAR-94;Build 9
  1. ;
  1. Q
  1. EN ; entry point
  1. D ERRCD
  1. D SEXFILL
  1. Q
  1. ;
  1. ERRCD ; add new error codes to 350.8
  1. N DO,DA,DIC,DIK,IBA,IBC,IBT,IBX,X,Y
  1. ;
  1. S IBC=0,(DIC,DIK)="^IBE(350.8,",DIC(0)=""
  1. F IBX=1:1 S IBT=$P($T(TXT+IBX),";",3) Q:'$L(IBT) D
  1. . Q:$D(^IBE(350.8,"AC",$P(IBT,"^",3))) ; already on file
  1. . K DO
  1. . S X=$P(IBT,"^")
  1. . D FILE^DICN I Y>0 S ^IBE(350.8,+Y,0)=IBT,DA=+Y,IBC=IBC+1 D IX^DIK
  1. ;
  1. S IBA(2)=" "_IBC_" entries added to 350.8"
  1. S (IBA(1),IBA(3))=""
  1. ;
  1. ERRCDX ;
  1. D MES^XPDUTL(.IBA)
  1. Q
  1. ;
  1. SEXFILL ; fill INSURED'S SEX field with value where possible
  1. D BMES^XPDUTL(" Starting update of new INSURED'S SEX field for all existing policies.")
  1. D MES^XPDUTL(" . . . . . . .")
  1. N IBDFN,IBDA,IBVTSX,IBSPSX,IBWHOSE,START,PCTR,END,TT,MIN,SEC,MSG
  1. T1 S START=$H,PCTR=0
  1. S IBDFN=0
  1. F S IBDFN=$O(^DPT(IBDFN)) Q:'IBDFN D
  1. . S PCTR=PCTR+1
  1. . Q:'$D(^DPT(IBDFN,.312)) ; no insurance to process
  1. . S IBVTSX=$P(^DPT(IBDFN,0),U,2) ; get veteran's sex
  1. . S IBSPSX=$TR(IBVTSX,"MF","FM") ; compute a spouse's sex in case it is needed
  1. . S IBDA=0
  1. . F S IBDA=$O(^DPT(IBDFN,.312,IBDA)) Q:'IBDA D
  1. .. S IBWHOSE=$P($G(^DPT(IBDFN,.312,IBDA,0)),U,6)
  1. .. Q:IBWHOSE="" Q:'("sv"[IBWHOSE) ; can't deal with anything but vet & spouse
  1. .. S $P(^DPT(IBDFN,.312,IBDA,3),U,12)=$S(IBWHOSE="v":IBVTSX,IBWHOSE="s":IBSPSX)
  1. T2 S END=$H
  1. D BMES^XPDUTL(" INSURED'S SEX field update complete.")
  1. S TT=$P(END,",",2)-$P(START,",",2),MIN=TT\60,SEC=TT#60
  1. S MSG=" "_$FN(PCTR,",")_" patient records were processed in "_MIN_" minutes and "_SEC_" seconds."
  1. D BMES^XPDUTL(MSG)
  1. Q
  1. TXT ; text of error messages to add
  1. ;;IB261^Primary insurance subscriber is missing INSURED'S SEX^IB261^1^1
  1. ;;IB262^Secondary insurance subscriber is missing INSURED'S SEX^IB262^1^1
  1. ;;IB263^Tertiary insurance subscriber is missing INSURED'S SEX^IB263^1^1