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

ACRFDHRV.m

Go to the documentation of this file.
ACRFDHRV ;IHS/OIRM/DSD/AEF - DHR VISUAL VERIFY [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGMT SYSTEM;;NOV 05, 2001
 ;
 ;This routine is used to visually verify DHR data in the DHR Data
 ;Records file
 ;
EN ;EP -- VISUAL VERIFY MAIN ENTRY POINT      
 ;
 N ACRADD,ACRD0,ACRD1,ACRD2,ACRD3,ACROPT,ACROUT
 D HOME^%ZIS
 D ^XBKVAR
 S (ACRADD,ACROUT)=0
 S ACROPT="1^6"
 D DISPLAY^ACRFDHRD(ACROPT)
 D SEL^ACRFDHRE(.ACRD0,.ACRD1,.ACRD2,.ACROUT,ACRADD,ACROPT,$G(ACRCLR))
 Q:$G(ACROUT)
 I $P(^AFSHRCDS(ACRD0,0),U,2) D  G EN
 . W *7,"This batch has been exported" H 2
 D EDIT(ACRD0,ACRD1,ACRD2,.ACROUT)
 G EN
EDIT(ACRD0,ACRD1,ACRD2,ACROUT)         ;
 ;----- EDIT RECORDS
 ;
 N ACRD3,ACRTYPE,Y
 S ACRD3=0
 F  S ACRD3=$O(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,"S",ACRD3)) Q:'ACRD3  D  Q:$G(ACROUT)
 . S ACRTYPE=$P(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,"S",ACRD3,0),U,2)
 . D EDIT^ACRFDHRE(ACRD0,ACRD1,ACRD2,ACRD3,ACRTYPE)
 . D NEXT(ACRD0,ACRD1,ACRD2,.Y,.ACROUT) Q:$G(ACROUT)
 . I +Y S ACRD3=+Y-1
 Q
NEXT(ACRD0,ACRD1,ACRD2,Y,ACROUT)       ;
 ;----- PROMPT FOR NEXT RECORD
 ;
B ;       
 N DIR,DIRUT,DTOUT,DUOUT
 S DIR(0)="FO"
 S DIR("A")="Next Record"
 S DIR("B")="NEXT"
 S DIR("?")="Enter RETURN to go to next record, '^' to quit, or record number ("_$O(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,"S","B",0))_"-"_$O(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,"S","B",99999),-1)_")"
 D ^DIR
 I $D(DTOUT)!($D(DUOUT))!($D(DIRUT)) S ACROUT=1 Q
 Q:Y="NEXT"
 I '$D(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,"S","B",+Y)) D  G B
 . W *7,"    Non-existent record"
 Q
CLOSE ;EP -- CLOSE DHR BATCH
 ;
 ;      Closes DHR batch and adds trailer record
 ;
 N ACRADD,ACRD0,ACRD1,ACRD2,ACROUT
 D HOME^%ZIS
 D ^XBKVAR
 S (ACRADD,ACROUT)=0
 S ACROPT="1^6"
 D DISPLAY^ACRFDHRD(ACROPT)
 D SEL^ACRFDHRE(.ACRD0,.ACRD1,.ACRD2,.ACROUT,ACRADD,ACROPT,$G(ACRCLR))
 Q:$G(ACROUT)
 I $P(^AFSHRCDS(ACRD0,0),U,2) D  G CLOSE
 . W *7,"This batch has been exported" H 2
 D TRAIL^ACRFDHRE(ACRD0,ACRD1,ACRD2)
 G CLOSE
 Q
SHOW ;EP -- DISPLAY DHR RECORDS
 ;
 N ACRADD,ACRD0,ACRD1,ACRD2,ACROPT,ACROUT
 D HOME^%ZIS
 D ^XBKVAR
 S (ACRADD,ACROUT)=0
 S ACROPT="1^6"
 D DISPLAY^ACRFDHRD(ACROPT)
 D SEL^ACRFDHRE(.ACRD0,.ACRD1,.ACRD2,.ACROUT,ACRADD,ACROPT,$G(ACRCLR))
 Q:$G(ACROUT)
 D LOOP(ACRD0,ACRD1,ACRD2,.ACROUT)
 G SHOW
LOOP(ACRD0,ACRD1,ACRD2,ACROUT)         ;
 ;----- LOOP THROUGH DHR RECORDS
 ;
 N ACRD3,BY,DIC,FLDS,FR,IOP,L,TO,X,Y
 S ACRD3=0
 F  S ACRD3=$O(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,"S",ACRD3)) Q:'ACRD3  D  Q:$G(ACROUT)
 . S DIC="^AFSHRCDS("
 . S L=0
 . S FLDS="[ACRF DHR DISPLAY]"
 . S BY=".01,1,.01,1,1,.01,1,1,6,.01"
 . S FR=$S(ACRD0=1:"PCC-BLUE",ACRD0=2:"PCC-RED",ACRD0=3:"BCBS-BLUE",ACRD0=4:"BCBS-RED",ACRD0=5:"ARMS-BLUE",ACRD0=6:"ARMS-RED",1:"")
 . S FR=FR_","_ACRD1_","
 . S FR=FR_$P($G(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,0)),U)
 . S FR=FR_","_ACRD3
 . S TO=FR
 . S IOP="HOME"
 . D EN1^DIP
 . D NEXT(ACRD0,ACRD1,ACRD2,.Y,.ACROUT)
 . I +Y S ACRD3=+Y-1
 Q
LIST ;EP -- LIST DHR RECORDS IN BATCH
 ;
 N ACRADD,ACRD0,ACRD1,ACRD2,ACROPT,ACROUT,BY,DIR,FLDS,FR,L,TO,X,Y
 D HOME^%ZIS
 D ^XBKVAR
 S (ACRADD,ACROUT)=0
 S ACROPT="1^6"
 D DISPLAY^ACRFDHRD(ACROPT)
 D SEL^ACRFDHRE(.ACRD0,.ACRD1,.ACRD2,.ACROUT,ACRADD,ACROPT,$G(ACRCLR))
 Q:$G(ACROUT)
 S DIC="^AFSHRCDS("
 S L=0
 S FLDS="[ACRF DHR STR DISPLAY]"
 S BY="@.01,1,@.01,1,1,@.01,1,1,6,@.01"
 S FR=$S(ACRD0=1:"PCC-BLUE",ACRD0=2:"PCC-RED",ACRD0=3:"BCBS-BLUE",ACRD0=4:"BCBS-RED",ACRD0=5:"ARMS-BLUE",ACRD0=6:"ARMS-RED",1:"")
 S FR=FR_","_ACRD1_","
 S FR=FR_$P($G(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,0)),U)
 S TO=FR
 S FR=FR_","_1
 S TO=TO_","_99999
 D EN1^DIP
 S DIR(0)="E"
 D ^DIR
 G LIST
 Q
BDEL ;EP -- DELETE BATCH
 ;
 N ACRADD,ACRD0,ACRD1,ACRD2,ACROPT,ACROUT,BATCH,DA,DIK,DIR,X,Y
 D HOME^%ZIS
 D ^XBKVAR
 S (ACRADD,ACROUT)=0
 S ACROPT="1^6"
 D DISPLAY^ACRFDHRD(ACROPT)
 D SEL^ACRFDHRE(.ACRD0,.ACRD1,.ACRD2,.ACROUT,ACRADD,ACROPT,$G(ACRCLR))
 Q:$G(ACROUT)
 S BATCH=$$DATE^ACRFDHRE($P(^AFSHRCDS(ACRD0,"D",ACRD1,0),U))_"-"_$P(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,0),U)
 S DIR(0)="Y"
 S DIR("A")="Are you sure you want to delete batch "_BATCH
 S DIR("B")="NO"
 W *7
 D ^DIR
 K DIR
 G BDEL:'Y
 S DA(2)=ACRD0
 S DA(1)=ACRD1
 S DA=ACRD2
 S DIK="^AFSHRCDS("_DA(2)_","_"""D"""_","_DA(1)_","_"""I"""_","
 D ^DIK
 W !,BATCH,"   <DELETED>"
 H 2
 G BDEL
 Q
STR(X) ;----- FORMAT DHR DATA STRING FOR DISPLAY
 ;
 ;      USED BY [ACRF DHR STR DISPLAY] PRINT TEMPLATE
 ;
 ;      X = The string to be formatted - from the zero node of 
 ;          the Sequence Number subfile of the DHR Data Records file
 ;
 N Y,Z
 S Z=$$PAD^ACRFUTL($P(X,U),"L",3,"")
 S Z=Z_"  "
 S Z=Z_$$PAD^ACRFUTL($P(X,U,2),"R",1,"")
 S Y=$P(X,U,3)
 S Y=$E(Y,4,7)_$E(Y,2,3)
 S Z=Z_$$PAD^ACRFUTL(Y,"R",6,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,4),"R",3,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,5),"R",1,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,6),"R",1,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,7),"R",3,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,8),"R",10,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,9),"R",3,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,10),"R",10,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,11),"R",1,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,12),"R",1,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,13),"R",7,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,14),"R",4,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,15),"L",12,$S($P(X,U,2)=3:"",1:0))
 S Z=Z_$$PAD^ACRFUTL($P(X,U,16),"R",1,"")
 S Z=Z_$$PAD^ACRFUTL($P(X,U,17),"R",15,"")
 Q Z