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

ACRFDHRD.m

Go to the documentation of this file.
ACRFDHRD ;IHS/OIRM/DSD/AEF - DRIVER ROUTINE FOR DHR ENTER/EDIT [ 11/01/2001   9:44 AM ]
 ;;2.1;ADMIN RESOURCE MGMT SYSTEM;;NOV 05, 2001
 ;
 ;
 ;This routine is used to enter/edit DHR data in the DHR Data Records
 ;file
 ;
EN ;EP -- ENTER/EDIT MAIN ENTRY POINT
 ;
 N ACRADD,ACRCLR,ACRD0,ACRD1,ACRD2,ACRD3,ACRDR,ACRDUP,ACROUT,ACRTYPE,ACROPT,DIR,X,Y
 D HOME^%ZIS
 D ^XBKVAR
 S (ACRDUP,ACROUT)=0
 S ACRADD=1
 D OPT^ACRFDHRE(.ACROPT,.ACROUT)
 Q:$G(ACROUT)
 D DISPLAY(ACROPT)
 D RB^ACRFDHRE(.ACRCLR)
 G EN:$G(ACROUT)
 D SEL^ACRFDHRE(.ACRD0,.ACRD1,.ACRD2,.ACROUT,ACRADD,ACROPT,.ACRCLR)
 G EN:$G(ACROUT)
 S DATA=$G(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,0))
 I $P(DATA,U,4)!($P(DATA,U,9)) D  G EN
 . W *7,"This batch has been exported" H 2
 I $P(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,0),U,3)="C" D
 . N DIR
 . W *7
 . S DIR(0)="Y"
 . S DIR("A")="This batch is closed, do you still want to add records"
 . S DIR("B")="NO"
 . D ^DIR
 . Q:'Y
 . D REOPEN^ACRFDHRE(ACRD0,ACRD1,ACRD2)
 I $P(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,0),U,3)="C" G EN
 K Y
 D TYPE^ACRFDHRE(.Y) ;Don't need this with 650 DHR
 G EN:Y']"" ;Don't need this with 650 DHR
 S ACRTYPE=Y ;Don't need this with 650 DHR
 I ACRTYPE=4 D TRAIL^ACRFDHRE(ACRD0,ACRD1,ACRD2) G EN ;Don't need this with 650 DHR
 F  D  Q:ACROUT
 . K ACRD3
 . D SEQ^ACRFDHRE(ACRD0,ACRD1,ACRD2,.ACRDR,ACRADD,.Y)
 . I Y'>0 S ACROUT=1 Q
 . S ACRD3=+Y
 . D EDIT^ACRFDHRE(ACRD0,ACRD1,ACRD2,ACRD3,ACRTYPE)
 . D DEL^ACRFDHRE(ACRD0,ACRD1,ACRD2,ACRD3,ACRTYPE)
 . D ADDFMS^ACRFDHRE(ACRD0,ACRD1,ACRD2,ACRD3,"M")
 . D DUPE^ACRFDHRE(ACRD0,ACRD1,ACRD2,ACRD3,.ACRDUP,.ACRDR)
 G EN
 Q
DISPLAY(ACROPT)    ;EP
 ;----- DISPLAY RECORD BATCHES
 ;   
 N ACRD0,ACRD1,ACRD2,ACRD3,CNT,DATA,I
 K ^TMP("ACRDHR",$J)
 F ACRD0=$P(ACROPT,U):1:$P(ACROPT,U,2) D
 . S ACRD1=0
 . F  S ACRD1=$O(^AFSHRCDS(ACRD0,"D",ACRD1)) Q:'ACRD1  D
 . . S ACRD2=0
 . . F  S ACRD2=$O(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2)) Q:'ACRD2  D
 . . . S DATA=$G(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,0))
 . . . Q:DATA']""
 . . . S (ACRD3,CNT)=0
 . . . F  S ACRD3=$O(^AFSHRCDS(ACRD0,"D",ACRD1,"I",ACRD2,"S",ACRD3)) Q:'ACRD3  D
 . . . . S CNT=CNT+1
 . . . S ^TMP("ACRDHR",$J,ACRD0,ACRD1,$P(DATA,U))=CNT_U_$P(DATA,U,3)_U_$S($P(DATA,U,4)]"":$P(DATA,U,4),1:$P($G(^AFSHRCDS(ACRD0,0)),U,2))_U_$P(DATA,U,9)
 Q:'$D(^TMP("ACRDHR",$J))
 W @IOF
 W !,"TYPE COLOR",?15,"DATE",?27,"ID",?34,"RCD",?42,"STATUS",?63,"650DHREXP DT"
 W !
 F I=1:1:80 W "-"
 W !
 S ACRD0=0
 F  S ACRD0=$O(^TMP("ACRDHR",$J,ACRD0)) Q:'ACRD0  D
 . W $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 ACRD1=0 F  S ACRD1=$O(^TMP("ACRDHR",$J,ACRD0,ACRD1)) Q:'ACRD1  D
 . . S ACRD2=""
 . . F  S ACRD2=$O(^TMP("ACRDHR",$J,ACRD0,ACRD1,ACRD2)) Q:ACRD2']""  D
 . . . S DATA=^TMP("ACRDHR",$J,ACRD0,ACRD1,ACRD2)
 . . . W ?15,$$DATE^ACRFDHRE(ACRD1)
 . . . W ?27,ACRD2
 . . . W ?32,$J($P(DATA,U),5)
 . . . W ?42,$S($P(DATA,U,2)="C":"CLOSED",1:"OPEN")
 . . . W ?63,$$DATE^ACRFDHRE($P(DATA,U,4))
 . . . W !
 K ^TMP("ACRDHR",$J)
 Q