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

IB20PT6.m

Go to the documentation of this file.
  1. IB20PT6 ;ALB/AAS - Insurance post init stuff ; 2/22/93
  1. ;;Version 2.0 ; INTEGRATED BILLING ;; 21-MAR-94
  1. ;
  1. % S IBFORCE=1
  1. I '$O(^IBA(355.3,0)) D ; -- one time updates (ins policy alerady exists
  1. .D PAT ; x-ref patient file by ins. co., add hip pointer
  1. .D 399^IB20PT61 ; add ae x-ref to file 399
  1. .D INPT ; load current inpatients into claims tracking
  1. ;
  1. K IBFORCE
  1. Q
  1. ;
  1. PAT ; -- create AB x-ref on patient file for all insurance co. pointers
  1. W !!!,"<<< Patient file insurance conversion"
  1. W !," Cross-reference patient file by Insurance company and",!," Update Health Insurance Policy Pointers"
  1. S ZTRTN="PATDQ^IB20PT6",ZTDESC="IB - v2 PATIENT FILE POST INIT UPDATE",ZTIO="" S:$G(IBFORCE) ZTDTH=$$15
  1. W ! D ^%ZTLOAD I '$D(ZTSK) D Q:'IBOK
  1. .D MANUAL^IB20PT61
  1. .I 'IBOK,$P($G(^IBE(350.9,1,3)),"^",18)="" W !!,"You must run the v2.0 post init routine IB20PT6 before allowing users to",!,"edit insurance information"
  1. I $D(ZTSK) W !," Patient file update queued as task ",ZTSK K ZTSK Q
  1. ;
  1. PATDQ D NOW^%DTC S IBSPDT=%
  1. I '$D(ZTQUEUED) D
  1. .W !!," I'll write a dot for each 100 entries"
  1. .W !," Start time: " S Y=IBSPDT D DT^DIQ
  1. N DFN,IBI,IBCPOL,IBCDFND,DA,DR,DIE,DIC,IBCNT,IBCNTP,IBCNTPP,IBCNTI
  1. S (IBCNT,IBCNTP,IBCNTPP,IBCNTI,DFN)=0
  1. F S DFN=$O(^DPT(DFN)) Q:'DFN S IBCNT=IBCNT+1,IBI=0 S:$O(^DPT(DFN,.312,IBI)) IBCNTI=IBCNTI+1 F S IBI=$O(^DPT(DFN,.312,IBI)) Q:'IBI D
  1. .I '$D(ZTQUEUED) W:'(IBCNTPP#100) "."
  1. .S IBCDFND=$G(^DPT(DFN,.312,IBI,0))
  1. .S ^DPT("AB",+IBCDFND,DFN,IBI)=""
  1. .S ^DPT(DFN,.312,"B",+IBCDFND,IBI)=""
  1. .Q:$P(IBCDFND,U,18)
  1. .S IBCPOL=$$CHIP^IBCNSU(IBCDFND)
  1. .Q:'IBCPOL
  1. .Q:+IBCDFND'=+$G(^IBA(355.3,+IBCPOL,0)) ; patient ins. and policy must have same ins. company file.
  1. .S IBCNTPP=IBCNTPP+1
  1. .S DA=IBI,DA(1)=DFN,DIE="^DPT("_DFN_",.312,"
  1. .S DR="1.09////1;.18////"_IBCPOL
  1. .D ^DIE K DA,DR,DIE,DIC
  1. .Q
  1. S $P(^IBE(350.9,1,3),"^",18)=DT
  1. D NOW^%DTC S IBEPDT=%
  1. D BULL1^IB20PT61
  1. I '$D(ZTQUEUED) D
  1. .W !!,"<<< Health Insurance Policy information updated"
  1. .W !," there were ",IBCNTPP," Policies for ",IBCNT," Patients were updated"
  1. .W !," causing ",IBCNTP," Health Insurance Policies to be added"
  1. .W !," Finish Time: " S Y=IBEPDT D DT^DIQ
  1. Q
  1. ;
  1. ;
  1. INPT ; -- load current inpatients into claims tracking
  1. W !!!,"<<< Load current inpatients into Claims Tracking"
  1. S ZTRTN="INPTDQ^IB20PT6",ZTDESC="IB - v2 CLAIMS TRACKING POST INIT UPDATE",ZTIO="" S:$G(IBFORCE) ZTDTH=$$15
  1. W ! D ^%ZTLOAD I '$D(ZTSK) D Q:'IBOK
  1. .D MANUAL^IB20PT61
  1. .I 'IBOK,$P($G(^IBE(350.9,1,3)),"^",20)="" W !!,"You must run the v2.0 post init routine IB20PT6 to automatically add",!,"Current inpatient into Claims Tracking."
  1. I $D(ZTSK) W !," Claims Tracking update queued as task ",ZTSK K ZTSK Q
  1. ;
  1. INPTDQ D NOW^%DTC S IBSTDT=%
  1. N WARD,DGPMDA,IBCNT,IB20
  1. S WARD="",DGPDMA=0,IBCNT=0,IB20=1
  1. F S WARD=$O(^DGPM("CN",WARD)) Q:WARD="" S DGPMDA=0 F S DGPMDA=$O(^DGPM("CN",WARD,DGPMDA)) Q:'DGPMDA D
  1. .S DGPMP=""
  1. .S DGPMA=$G(^DGPM(DGPMDA,0)) Q:DGPMA=""
  1. .S DFN=$P(DGPMA,"^",3) Q:'DFN
  1. .D INP^VADPT
  1. .K IBNEW D INP^IBTRKR
  1. .I $G(IBNEW) S IBCNT=IBCNT+1 I '$D(ZTQUEUED) W !," Patient ",$P(^DPT(DFN,0),U)," added to the Claims tracking module"
  1. ;
  1. I '$D(ZTQUEUED) W !!,"<<< ",IBCNT," Patients added to the Claims Tracking Module"
  1. D NOW^%DTC S IBETDT=%
  1. D BULL3^IB20PT61
  1. S $P(^IBE(350.9,1,3),"^",20)=DT
  1. Q
  1. ;
  1. 15() ; -- Add 15 minutes to now and return in $h format
  1. Q $P($H,",")_","_($P($H,",",2)+(15*60))