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

ABMMRS4.m

Go to the documentation of this file.
ABMMRS4 ; IHS/ASDST/DMJ - STANDALONE TO FIX CORRUPTED DATA IN BILL FILE ; 
 ;;2.4;IHS 3P BILLING SYSTEM;;APR 14, 2000
 ;IHS/DSD/MRS
 ;
INIT S (CLAIM,BDFN,DFN,SITE)="",X="BILL",Y="NULL",U="^"
 S DIE="^ABMDBILL(DUZ(2),"
 F  S CLAIM=$O(^ABMMRS1(CLAIM)) Q:CLAIM=""  D
 .F  S BDFN=$O(^ABMMRS1(CLAIM,BDFN)) Q:BDFN=""  D
 ..F  S SITE=$O(^ABMMRS(CLAIM,BDFN,"BILL","NULL",SITE)) Q:SITE=""  D SEP
 Q
SEP ;Separate pieces from string to re-populate bill file
 I '$D(^ABMDBILL(SITE,BDFN,0)) S ^ABMMRS99(CLAIM,BDFN,SITE)="" Q  ;Trap
 S TMP=^ABMDBILL(SITE,BDFN,0),TMPAT=$P(TMP,U,6),TMPBTYP=$P(TMP,U,2)
 I TMPAT'="" S ^ABMMRS99(CLAIM,BDFN,SITE)=TMP Q  ; Trap suspect bills
 I $L(TMP,U)'=4 S ^ABMMRS99(CLAIM,BDFN,SITE)=TMP Q  ; Trap suspect bills
 ; OK to piece and set
 S STR=^ABMMRS1(CLAIM,BDFN,"BILL","NULL",SITE)
 S BTYP=$P(STR,U,2),VLOC=$P(STR,U,3),STAT=$P(STR,U,4)
 S PAT=$P(STR,U,5),MODE=$P(STR,U,6),VTYP=$P(STR,U,7),IIEN=$P(STR,U,8)
 S CODE=$P(STR,U,9),CLINIC=$P(STR,U,10)
 I VLOC="" S VLOC=SITE
 I BTYP="" S BTYP=TMPBTYP
 D SET
 Q
SET ; Use fileman and re-populate bill file
 S DA=BDFN,DUZ(2)=SITE
 S DR=".03////"_VLOC_";.04////"_STAT_";.05////"_PAT_";.06////"_MODE_";.07////"_VTYP_";.08////"_IIEN_";.09////"_CODE_";.1////"_CLINIC
 D ^DIE K DA,DR
 Q