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

PRPFDR5.m

Go to the documentation of this file.
PRPFDR5 ;BAYPINES/MJE  VPFS DATA MIGRATION ROUTINE 5 ;05/15/03
 ;;3.0;PATIENT FUNDS DIAG V5.9;**15**;JUNE 1, 1989
 ;BAD ENTRY POINT
 Q
NODE0 S PFNODE0=^PRPF(470,PRPFHLD1,0)
 S PFNAMEX=""
 S PFNAMEX=PFNAME
 I PFNAME=""!($E(PFNAME,1,12)="NAME-MISSING") D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,1,PFNAME_"_"_PRPFHLD1)="NAME^Name is blank^"_PFNAME
 .S CNTERR(1)=CNTERR(1)+1
 .S CNTERR(100)=CNTERR(100)+1
 ELSE  I $$FORMAT^XLFNAME7(PFNAMEX,3,30)'=PFNAMEX D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,2,PFNAME_"_"_PRPFHLD1)="NAME^Patient Name contains invalid data^"_PFNAME
 .S CNTERR(2)=CNTERR(2)+1
 .S CNTERR(100)=CNTERR(100)+1
 I PFSSN="" D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,3,PFNAME_"_"_PRPFHLD1)="SSN^SSN is blank^"_PFSSN
 .S CNTERR(3)=CNTERR(3)+1
 .S CNTERR(100)=CNTERR(100)+1
 I PFSSN'="" D
 .I $L(PFSSN)<9!($L(PFSSN)>10) D
 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,4,PFNAME_"_"_PRPFHLD1)="SSN^SSN that is not 9 digits or has non-numeric values^"_PFSSN
 ..S CNTERR(4)=CNTERR(4)+1
 ..S CNTERR(100)=CNTERR(100)+1
 .I $L(PFSSN)=9 D
 ..I '(PFSSN?.9N) D
 ...S ^TMP("PRPF_DIAGX",$J,PFSTAID,4.1,PFNAME_"_"_PRPFHLD1)="SSN^SSN that is not 9 digits or has non-numeric values^"_PFSSN
 ...S CNTERR(4)=CNTERR(4)+1
 ...S CNTERR(100)=CNTERR(100)+1
 .I $L(PFSSN)=10 D
 ..I ($E(PFSSN,1,9)?.9N)&($E(PFSSN,10,10)="P") D
 ...S ^TMP("PRPF_DIAGX",$J,PFSTAID,6,PFNAME_"_"_PRPFHLD1)="SSN^PSEUDO SSN value^"_PFSSN
 ...S CNTRPSU=CNTRPSU+1
 ..I '($E(PFSSN,1,9)?.9N)!($E(PFSSN,10,10)'="P") D
 ...S ^TMP("PRPF_DIAGX",$J,PFSTAID,4.2,PFNAME_"_"_PRPFHLD1)="SSN^SSN that is not 9 digits or has non-numeric values^"_PFSSN
 ...S CNTERR(4)=CNTERR(4)+1
 ...S CNTERR(100)=CNTERR(100)+1
 I PFSSN'="" D
 .I $D(^TMP("PRPF_DIAGX",$J,"PFSSN",PFSSN)) D
 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,5,PFNAME_"_"_PRPFHLD1)="SSN^SSN duplicate value^"_PFSSN
 ..S CNTERR(5)=CNTERR(5)+1
 ..S CNTERR(100)=CNTERR(100)+1
 .S ^TMP("PRPF_DIAGX",$J,"PFSSN",PFSSN)=PFSSN
 I PFDOB="" D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,7,PFNAME_"_"_PRPFHLD1)="DOB^DOB blank^"_PFDOB
 .S CNTERR(7)=CNTERR(7)+1
 .S CNTERR(100)=CNTERR(100)+1
 ELSE  D
 .K PRPFBADD
 .D DT^DILF("X",PFDOB,.PRPFBADD)
 .I $L(+PFDOB)'=7!(PRPFBADD=-1) D
 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,8,PFNAME_"_"_PRPFHLD1)="DOB^DOB contains invalid date^"_PFDOB
 ..S CNTERR(8)=CNTERR(8)+1
 ..S CNTERR(100)=CNTERR(100)+1
 I PFWARD'="" I $L(PFWARD)>30!($L(PFWARD)<2) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,9,PFNAME_"_"_PRPFHLD1)="WARD^Ward loc invalid length not 2 TO 30^"_PFWARD
 .S CNTERR(9)=CNTERR(9)+1
 .S CNTERR(100)=CNTERR(100)+1
 I PFCLAIM=""!(PFCLAIM="SS") D
 .;S ^TMP("PRPF_DIAGX",$J,PFSTAID,8,PFNAME_"_"_PRPFHLD1)="CLAIM#^Claim # blank^"_PFCLAIM
 .;S CNTERR(8)=CNTERR(8)+1
 .;S CNTERR(100)=CNTERR(100)+1
 ELSE  I $L(PFCLAIM)<7!($L(PFCLAIM)>9)!'(PFCLAIM?.N) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,10,PFNAME_"_"_PRPFHLD1)="CLAIM#^Claim # < 7 or > 9 digits or non-numeric^"_PFCLAIM
 .S CNTERR(10)=CNTERR(10)+1
 .S CNTERR(100)=CNTERR(100)+1
 I PFSTATE="" D
 .;S ^TMP("PRPF_DIAGX",$J,PFSTAID,10,PFNAME_"_"_PRPFHLD1)="STATE^STATE field is blank^"_PFSTATE
 .;S CNTERR(10)=CNTERR(10)+1
 .;S CNTERR(100)=CNTERR(100)+1
 I PFZIP="" D
 .;S ^TMP("PRPF_DIAGX",$J,PFSTAID,11,PFNAME_"_"_PRPFHLD1)="ZIPCODE#^ZIPCODE blank^"_PFZIP
 .;S CNTERR(11)=CNTERR(11)+1
 .;S CNTERR(100)=CNTERR(100)+1
 ELSE  I $L(PFZIP)>5!($L(PFZIP)<5)!'(PFZIP?5N) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,11,PFNAME_"_"_PRPFHLD1)="ZIPCODE#^ZIPCODE < or > 5 digits or non-numeric^"_PFZIP
 .S CNTERR(11)=CNTERR(11)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFRGNID=""
 S PFICNFLG=$$GETICN^MPIF001(PRPFHLD1)
 I +PFICNFLG'=-1 D
 .I $D(^TMP("PRPF_DIAGX",$J,"PFICN",+PFICNFLG)) D
 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,13,PFNAME_"_"_PRPFHLD1)="ICN^ICN Duplicate^"_PFICNFLG
 ..S CNTERR(13)=CNTERR(13)+1
 ..S CNTERR(100)=CNTERR(100)+1
 .S ^TMP("PRPF_DIAGX",$J,"PFICN",+PFICNFLG)=PFICNFLG
 I +PFICNFLG=-1 D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,14,PFNAME_"_"_PRPFHLD1)="ICN^ICN Unassigned or invalid^"_$P(PFICNFLG,"^",2)
 .S CNTERR(14)=CNTERR(14)+1
 .S CNTERR(100)=CNTERR(100)+1
 .;S PRPFBJOB=$$MPIQQ^MPIFAPI(PRPFHLD1)
 S (PFAUTHRS,PFNAMEX)=""
 I PFAUTH'="" D
 .S (PFAUTHRS,PFNAMEX)=$P($G(^VA(200,PFAUTH,0)),"^",1)
 .I $$FORMAT^XLFNAME7(PFNAMEX,3,30)'=PFNAMEX!('$D(^VA(200,PFAUTH,0))) D
 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,15,PFNAME_"_"_PRPFHLD1)="PFAUTHRS^Provider name contains invalid data^"_PFAUTHRS
 ..S CNTERR(15)=CNTERR(15)+1
 ..S CNTERR(100)=CNTERR(100)+1
 S PFAUTHDT=$P(^PRPF(470,PRPFHLD1,0),"^",12)
 I PFAUTHDT'="" D
 .K PRPFBADD
 .D DT^DILF("X",PFAUTHDT,.PRPFBADD)
 .I $L(+PFAUTHDT)'=7!(PRPFBADD=-1) D
 ..S ^TMP("PRPF_DIAGX",$J,PFSTAID,16,PFNAME_"_"_PRPFHLD1)="PROVAUTHDT^Date of current restriction contains invalid date^"_PFAUTHDT
 ..S CNTERR(16)=CNTERR(16)+1
 ..S CNTERR(100)=CNTERR(100)+1
 S PFSTAT=$P(PFNODE0,"^",2)
 I PFSTAT="" D
 .S PRPFBC18=PRPFBC18+1
 I PFSTAT'["A"&(PFSTAT'["I")&(PFSTAT'="") D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,18,PFNAME_"_"_PRPFHLD1)="ACCOUNT STATUS^Account status containing values other than A or I^"_PFSTAT
 .S CNTERR(18)=CNTERR(18)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFTYPE=$P(PFNODE0,"^",3)
 I PFTYPE="" D
 .S PRPFBC19=PRPFBC19+1
 I PFTYPE'["L"&(PFTYPE'["R")&(PFTYPE'["U")&(PFTYPE'["X")&(PFTYPE'="") D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,19,PFNAME_"_"_PRPFHLD1)="PATIENT TYPE^Patient type values other than L, R, U, X^"_PFTYPE
 .S CNTERR(19)=CNTERR(19)+1
 .S CNTERR(100)=CNTERR(100)+1
 I (PFAUTH=""&(PFTYPE="L"))!(PFAUTH=""&(PFTYPE="R")) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,20,PFNAME_"_"_PRPFHLD1)="PATIENT TYPE/PHY^No Physician name for L or R^"_PFTYPE
 .S CNTERR(20)=CNTERR(20)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFPSTAT=$P(PFNODE0,"^",4)
 I PFPSTAT="" D
 .S PRPFBC21=PRPFBC21+1
 I PFPSTAT'["A"&(PFPSTAT'["R")&(PFPSTAT'["C")&(PFPSTAT'["N")&(PFPSTAT'["X")&(PFPSTAT'="") D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,21,PFNAME_"_"_PRPFHLD1)="PATIENT STATUS^Patient status values other than A, R, C, N, X^"_PFPSTAT
 .S CNTERR(21)=CNTERR(21)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFINDIG=$P(PFNODE0,"^",5)
 I PFINDIG="" D
 .S PRPFBC22=PRPFBC22+1
 I PFINDIG'["Y"&(PFINDIG'["N")&(PFINDIG'="") D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,22,PFNAME_"_"_PRPFHLD1)="INDIGENT^Indigent indicator values other than Y, N^"_PFINDIG
 .S CNTERR(22)=CNTERR(22)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFAPPOR=$P(PFNODE0,"^",6)
 I PFAPPOR'="" I PFAPPOR<0!(PFAPPOR>99999)!((PFAPPOR'=+PFAPPOR)&(PFAPPOR'?.N1".".N)) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,23,PFNAME_"_"_PRPFHLD1)="APPORTIONEE $^Apportionee amount invalid or out of range either < 0 or > $99,999.00^"_PFAPPOR
 .S CNTERR(23)=CNTERR(23)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFGUARD=$P(PFNODE0,"^",7)
 I PFGUARD'="" I PFGUARD<0!(PFGUARD>99999)!((PFGUARD'=+PFGUARD)&(PFGUARD'?.N1".".N)) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,24,PFNAME_"_"_PRPFHLD1)="GUARDIAN $^Guardian amount invalid or out of range either < 0 or > $99,999.00^"_PFGUARD
 .S CNTERR(24)=CNTERR(24)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFINSAWD=$P(PFNODE0,"^",8)
 I PFINSAWD'="" I PFINSAWD<0!(PFINSAWD>99999)!((PFINSAWD'=+PFINSAWD)&(PFINSAWD'?.N1".".N)) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,25,PFNAME_"_"_PRPFHLD1)="INSTITUTIONAL AWARD^Institutional award invalid or out of range either < 0 or > $99,999.00^"_PFINSAWD
 .S CNTERR(25)=CNTERR(25)+1
 .S CNTERR(100)=CNTERR(100)+1
 S PFOTRAST=$P(PFNODE0,"^",10)
 I PFOTRAST'="" I PFOTRAST<0!(PFOTRAST>99999)!((PFOTRAST'=+PFOTRAST)&(PFOTRAST'?.N1".".N)) D
 .S ^TMP("PRPF_DIAGX",$J,PFSTAID,26,PFNAME_"_"_PRPFHLD1)="OTHER ASSETS^Other assets invalid or out of range either < 0 or > $99,999.00^"_PFOTRAST
 .S CNTERR(26)=CNTERR(26)+1
 .S CNTERR(100)=CNTERR(100)+1
 Q
NODE0X S ^TMP("PRPF_DIAGX",$J,PFSTAID,17,PFNAME_"_"_PRPFHLD1)="NO DEMO RECORD^No demographic record for account^"_PFNAME
 S CNTERR(17)=CNTERR(17)+1
 S CNTERR(100)=CNTERR(100)+1
 Q