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

IBYEPT1.m

Go to the documentation of this file.
  1. IBYEPT1 ;ALB/CPM - PATCH IB*2*40 POST INIT (CON'T) ; 22-AUG-95
  1. ;;Version 2.0 ; INTEGRATED BILLING ;**40**; 21-MAR-94
  1. ;
  1. EN ; Entry point to queue 'Name of Insured' clean up job.
  1. ;
  1. W !!,">>> I need to queue a job to clean up the 'Name of Insured' fields in"
  1. W !," the PATIENT (#2) and BILL/CLAIMS (#399) files...",!
  1. ;
  1. ; - queue the job
  1. S ZTRTN="DQ^IBYEPT1",ZTIO="",ZTDESC="IB - CORRECT 'NAME OF INSURED' VALUES"
  1. D ^%ZTLOAD W !!,$S($D(ZTSK):"This job has been queued. The task number is "_ZTSK_".",1:"")
  1. W:$D(ZTSK) !,"Please note that you will receive a mail message when this job has completed."
  1. K X,Y,DIRUT,DUOUT,DTOUR,DIROUT,ZTSK
  1. Q
  1. ;
  1. ;
  1. ;
  1. DQ ; Queued entry point to start the job.
  1. ;
  1. D NOW^%DTC S IBBDT=%
  1. ;
  1. S (IBCPOL,IBCBILL)=0
  1. ;
  1. ; - fix policies in file #2
  1. S DFN=0 F S DFN=$O(^DPT(DFN)) Q:'DFN S IBCDFN=0 F S IBCDFN=$O(^DPT(DFN,.312,IBCDFN)) Q:'IBCDFN S IBNI=$P($G(^(IBCDFN,0)),"^",17) I IBNI?1"`"1.N D
  1. .S IBNAM=$$NAME(IBNI,DFN) Q:IBNAM<0
  1. .S $P(^DPT(DFN,.312,IBCDFN,0),"^",17)=IBNAM,IBCPOL=IBCPOL+1
  1. ;
  1. ; - fix patient's bills in file #399
  1. S IBIFN=0 F S IBIFN=$O(^DGCR(399,IBIFN)) Q:'IBIFN D
  1. .F IBNOD="I1","I2","I3" S IBNI=$P($G(^DGCR(399,IBIFN,IBNOD)),"^",17) I IBNI?1"`"1.N D
  1. ..S IBNAM=$$NAME(IBNI,+$P($G(^DGCR(399,IBIFN,0)),"^",2)) Q:IBNAM<0
  1. ..S $P(^DGCR(399,IBIFN,IBNOD),"^",17)=IBNAM,IBCBILL=IBCBILL+1
  1. ;
  1. D NOW^%DTC S IBEDT=%
  1. ;
  1. D MAIL
  1. ;
  1. K IBBDT,IBEDT,DFN,IBCDFN,IBNI,IBNAM,IBCPOL,IBCBILL,IBIFN,IBNOD
  1. Q
  1. ;
  1. ;
  1. NAME(IBNI,DFN) ; Find the name associated with the ien for Name of Insured.
  1. ; Input: IBNI -- Value of the Name of Insured stored in the policy
  1. ; DFN -- Pointer to the patient in file #2
  1. ;
  1. N NAME
  1. I $E(IBNI,2,99)=DFN S NAME=$P($G(^DPT(DFN,0)),"^") G NAMEQ
  1. N DIC,DFN,DGSENFLG,X S DGSENFLG=1
  1. S X=IBNI,DIC="^DPT(",DIC(0)="Z" D ^DIC S NAME=$S(Y<0:-1,1:$P($G(^DPT(+Y,0)),"^"))
  1. NAMEQ Q NAME
  1. ;
  1. ;
  1. MAIL ; Send the bulletin
  1. S XMSUB="Job Completion - Correct 'Name of Insured' Fields"
  1. S XMDUZ="INTEGRATED BILLING",XMTEXT="IBT(",XMY(DUZ)=""
  1. ;
  1. K IBT
  1. S IBT(1)="The job to correct the 'Name of Insured' fields in files #2 and #399"
  1. S IBT(2)="has completed."
  1. S IBT(3)=" "
  1. S Y=IBBDT D D^DIQ S IBT(4)="Job Start Time: "_Y
  1. S Y=IBEDT D D^DIQ S IBT(5)=" Job End Time: "_Y
  1. S IBT(6)=" "
  1. S IBT(7)="Number of policies corrected in file #2: "_IBCPOL
  1. S IBT(8)=" Number of bills corrected in file #399: "_IBCBILL
  1. ;
  1. D ^XMD
  1. K IBT,XMSUB,XMTEXT,XMDUZ,XMY,Y
  1. Q