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

IVM20P19.m

Go to the documentation of this file.
  1. IVM20P19 ;ALB/KCL - Post-Install Extract ; 1-SEP-1998
  1. ;;2.0;INCOME VERIFICATION MATCH;**19**; 21-OCT-94
  1. ;
  1. ;
  1. POST ; Entry point for post-install, setup check points
  1. N %
  1. S %=$$NEWCP^XPDUTL("DFN","EN^IVM20P19",0)
  1. Q
  1. ;
  1. ;
  1. EN ; Description: This entry point will be the driver for the extract.
  1. ;
  1. ; Input: None
  1. ; Output: None
  1. ;
  1. N IVMARRAY,IVMBEGDT,IVMENDDT
  1. ;
  1. ; init variables (start/end date for search)
  1. S IVMBEGDT=2961001
  1. S IVMENDDT=DT
  1. ;
  1. ; perform extract, display results during post-install
  1. D BMES^XPDUTL(" Examining the PATIENT #2 file...")
  1. D EXTRACT(IVMBEGDT,IVMENDDT,.IVMARRAY)
  1. ;
  1. D MES^XPDUTL(" Total patients processed: "_IVMARRAY("PROC"))
  1. D MES^XPDUTL(" Total patients extracted: "_IVMARRAY("EXTRACT"))
  1. D MES^XPDUTL(" Percentage extracted: "_$S($G(IVMARRAY("PROC")):$P(IVMARRAY("EXTRACT")/IVMARRAY("PROC")*100,".")_"%",1:""))
  1. D MES^XPDUTL("")
  1. D MES^XPDUTL(" The "_IVMARRAY("EXTRACT")_" patients extracted will be included in the next daily")
  1. D MES^XPDUTL(" transmission(s) to the Health Eligibility Center (HEC).")
  1. ;
  1. ; send extract results bulletin
  1. D BMES^XPDUTL(" Sending extract results bulletin...")
  1. D BULL(.IVMARRAY)
  1. Q
  1. ;
  1. ;
  1. EXTRACT(BEGDT,ENDDT,IVMARRAY) ; Description: Used to perform the extract and log patients in the IVM PATIENT file for transmission if selected.
  1. ;
  1. ; Input:
  1. ; BEGDT - as begin date for extract search
  1. ; ENDDT - as end date for extract search
  1. ;
  1. ; Output:
  1. ; IVMARRAY - as local array containing extract results, pass by reference
  1. ;
  1. N DFN
  1. ;
  1. ; init varibles
  1. K IVMARRAY S IVMARRAY=""
  1. S IVMARRAY("START")=$$NOW^XLFDT ; current date/time started
  1. S IVMARRAY("PROC")=0 ; count of patients processed
  1. S IVMARRAY("EXTRACT")=0 ; count of patients extracted
  1. S IVMARRAY("TOTAL")=$P($G(^DPT(0)),"^",4) ; total patients to check
  1. S XPDIDTOT=IVMARRAY("TOTAL") ; total patients for status bar
  1. S IVMARRAY("UPDATE%")=5 ; init % for status bar update
  1. ;
  1. ; retrieve checkpoint parameter value to init DFN, previous run
  1. S DFN=+$$PARCP^XPDUTL("DFN")
  1. ;
  1. ; loop thru patients in PATIENT (#2) file
  1. F S DFN=$O(^DPT(DFN)) Q:'DFN D
  1. .;
  1. .; - update checkpoint parameter DFN
  1. .S %=$$UPCP^XPDUTL("DFN",DFN)
  1. .;
  1. .S IVMARRAY("PROC")=IVMARRAY("PROC")+1
  1. .;
  1. .; - update status bar during post-install if not queued
  1. .I '$D(ZTQUEUED) D
  1. ..S IVMARRAY("COMP%")=IVMARRAY("PROC")*100/IVMARRAY("TOTAL") ; % complete
  1. ..I IVMARRAY("COMP%")>IVMARRAY("UPDATE%") D
  1. ...D UPDATE^XPDID(IVMARRAY("PROC"))
  1. ...S IVMARRAY("UPDATE%")=IVMARRAY("UPDATE%")+5 ; increase update %
  1. .;
  1. .; - quit if patient does not pass 1/98 bulk extract criteria
  1. .Q:'$$CRITERIA^IVMBULK1(DFN,BEGDT,ENDDT)
  1. .;
  1. .; - quit if patient does not pass current selection criteria
  1. .Q:'$$SELECT(DFN)
  1. .;
  1. .; - log patient for transmission in IVM PATIENT file
  1. .N EVENTS
  1. .S EVENTS("ENROLL")=1
  1. .I $$LOG^IVMPLOG(DFN,$$YEAR^IVMPLOG(DFN),.EVENTS) S IVMARRAY("EXTRACT")=IVMARRAY("EXTRACT")+1
  1. .;
  1. ;
  1. S IVMARRAY("STOP")=$$NOW^XLFDT ; current date/time stopped
  1. Q
  1. ;
  1. ;
  1. SELECT(DFN) ; Description: This function will determine if the patient meets the following extract selection criteria:
  1. ;
  1. ; [Patient has SERVICE CONNECTED PERCENTAGE=0]
  1. ; OR
  1. ; [Patient has Other Entitled Eligibilities]
  1. ;
  1. ; Input:
  1. ; DFN - as ien of record in PATIENT (#2) file
  1. ;
  1. ; Output:
  1. ; Function Value - Return 1 if patient meets the selection criteria, otherwise 0 is returned
  1. ;
  1. N SELECT S SELECT=0
  1. ;
  1. ; does the patient have an SC %=0?
  1. I $$SCZERO(DFN) S SELECT=1 G SELECTQ
  1. ;
  1. ; does patient have other entitled eligibilities?
  1. I $$OTHELIG(DFN) S SELECT=1
  1. ;
  1. SELECTQ Q SELECT
  1. ;
  1. ;
  1. SCZERO(DFN) ; Description: Used to determine if a patient has a SERVICE CONNECTED PERCENTAGE equal to zero.
  1. ;
  1. ; Input:
  1. ; DFN - as ien of record in PATIENT (#2) file
  1. ;
  1. ; Output:
  1. ; Function Value - Return 1 if patient has a SERVICE CONNECTED PERCENTAGE equal to zero, otherwise return 0
  1. ;
  1. N SCZERO S SCZERO=0
  1. ;
  1. I $G(DFN),$D(^DPT(DFN,0)) D
  1. .I $P($G(^DPT(DFN,.3)),"^",2)=0 S SCZERO=1
  1. ;
  1. Q SCZERO
  1. ;
  1. ;
  1. OTHELIG(DFN) ; Description: Used to determine if a patient has OTHER ENTITLED ELIGIBILITIES.
  1. ;
  1. ; Input:
  1. ; DFN - as ien of record in PATIENT (#2) file
  1. ;
  1. ; Output:
  1. ; Function Value - return 1 if patient has other entitled eligibilities, otherwise return 0
  1. ;
  1. N OTH,OTHELIG,PRIME
  1. S (OTHELIG,OTH)=0
  1. ;
  1. I $G(DFN),$D(^DPT(DFN,0)) S PRIME=+$G(^DPT(DFN,.36))
  1. ;
  1. ; if Primary Eligibility, check for Other Entitled Eligibilities
  1. I $G(PRIME) D
  1. .F S OTHELIG=$O(^DPT(DFN,"E",OTHELIG)) Q:'OTHELIG!(OTH=1) D
  1. ..I OTHELIG'=PRIME S OTH=1
  1. ;
  1. Q OTH
  1. ;
  1. ;
  1. BULL(IVMARRAY) ; Description: This function will generate a MailMan message contianing the extract results.
  1. ;
  1. ; Input:
  1. ; IVMARRAY - as local array containing extract results
  1. ;
  1. ; Output: None
  1. ;
  1. K XMZ
  1. N IVMTXT,IVMSITE,XMTEXT,XMSUB,XMDUZ,XMY
  1. N DIFROM ; must new DIFROM when calling MailMan
  1. ;
  1. ; init variables
  1. S IVMSITE=$$SITE^VASITE
  1. S XMSUB="Patch IVM*2*19 Extract Results "_"("_$P(IVMSITE,"^",3)_")"
  1. S XMDUZ=.5
  1. S XMY(DUZ)="",XMY(.5)="",XMY("G.ENROLLMENT EXTRACT@IVM.DOMAIN.EXT")=""
  1. S XMTEXT="IVMTXT("
  1. ;
  1. S IVMTXT(1)=" > > > > Patch IVM*2*19 Extract Results < < < <"
  1. S IVMTXT(2)=""
  1. S IVMTXT(3)=" Facility Name: "_$P(IVMSITE,"^",2)
  1. S IVMTXT(4)=" Station Number: "_$P(IVMSITE,"^",3)
  1. S IVMTXT(5)=""
  1. S IVMTXT(6)=" Date/Time extract started: "_$$FMTE^XLFDT(IVMARRAY("START"),"1P")
  1. S IVMTXT(7)=" Date/Time extract stopped: "_$$FMTE^XLFDT(IVMARRAY("STOP"),"1P")
  1. S IVMTXT(8)=""
  1. S IVMTXT(9)=" Total patients processed: "_IVMARRAY("PROC")
  1. S IVMTXT(10)=" Total patients extracted: "_IVMARRAY("EXTRACT")
  1. S IVMTXT(11)=" Percentage extracted: "_$S($G(IVMARRAY("PROC")):$P(IVMARRAY("EXTRACT")/IVMARRAY("PROC")*100,".")_"%",1:"")
  1. S IVMTXT(12)=""
  1. S IVMTXT(13)=" The "_IVMARRAY("EXTRACT")_" patients extracted will be included in the next daily"
  1. S IVMTXT(14)=" transmission(s) to the Health Eligibility Center (HEC)."
  1. ;
  1. D ^XMD
  1. Q