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

ACHSTXF1.m

Go to the documentation of this file.
ACHSTXF1 ; IHS/OIT/FCJ - RE-EXPORT DATA - RECORD 2U(UFMS), SPECIFIC RECORDS AND BATCHES ;
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**14,15**;JUN 11,2001
 ;ACHS*3.1*14 IHS/OIT/FCJ New routine
 ; This routine is called from ACHSTXAR, for use with re-exporting 
 ; specifically selected document transactions.
 ;
 D LINES^ACHSFU
 W @IOF,!,$$REPEAT^XLFSTR("*",80),!,$$C^XBFUNC("RE-EXPORT SELECTED CHS DATA"),!,$$REPEAT^XLFSTR("*"),!
 S ACHSCHSS=""
 D ^ACHSUF
 K ACHSCHSS
 I '$D(ACHS("REXNUM")) D KILLGLBS^ACHSTX S ACHSBDT=0,ACHSEDT=3990000
 S (J,ACHSDCR)=0,ACHSRR="",ACHSF638=$$PARM^ACHS(0,8)
 F ACHS=2:1:7 S ACHSRTYP(ACHS)=0
 W !?10,"FACILITY NAME: ",$$LOC^ACHS
S2 ;
 S ACHSFDT=ACHSBDT
 S ACHSAFAC=$P(^AUTTLOC(DUZ(2),0),U,10)
 I $$PARM^ACHS(2,25)="Y" S X=$$PARM^ACHS(0,12) G AFACERR:+X<1 S ACHSAFAC=$P(^AUTTLOC(X,0),U,10)
 I +ACHSAFAC<1 G AFACERR
 I $$PARM^ACHS(2,9)="Y" F ACHS="252F","254V" S ACHS(ACHS)=$O(^ACHS(3,DUZ(2),1,"B",ACHS,0))
 I ACHSF638="Y",$$PARM^ACHS(2,9)="Y" F ACHS="252G","252R","254D","254L","254M" S ACHS(ACHS)=$O(^ACHS(3,DUZ(2),1,"B",ACHS,0))
 I $D(ACHS("REXNUM")) G RXB
S3 ;
 S ACHSBDT=$O(^TMP("ACHSTXAR",$J,ACHSBDT))
 G CVTEND1:ACHSBDT<1!(ACHSBDT>ACHSEDT)
 S ACHSLDAT=ACHSBDT
 S P=""
S4 ;
 S P=$O(^TMP("ACHSTXAR",$J,ACHSBDT,P))
 G S3:P=""
 S (ACHSDOCR,ACHSDOCN,ACHSDOCT,ACHSIPA,ACHSDEST,ACHSCTY,ACHSDR3,ACHSTOS,ACHSDFY,X1)=""
 S (ACHSXLOC,ACHSCDE,ACHSARCO,ACHSPROV,ACHSFED,ACHSEIN,ACHSDUNS,ACHSCTYP)=""
 G S4:'$D(^ACHSF(DUZ(2),"D",P,0)) S ACHSDOCR=^(0)
 G S4:$P(ACHSDOCR,U,3)=2  ;skip special transactions
 S DA=0
S5 ;
 S DA=$O(^TMP("ACHSTXAR",$J,ACHSBDT,P,DA))
 G S4:DA<1
 G S5:'$D(^ACHSF(DUZ(2),"D",P,"T",DA,0)) S ACHSDOCT=^(0)
 S ACHSTY=$P(ACHSDOCT,U,2)
 ;ACHS*3.1*15 3.9.2009 IHS.OIT.FCJ ADDED "P" TO NXT LINE
 G S5:ACHSTY="ZA"!(ACHSTY="IP")!(ACHSTY="P")  ;skip paid documents
 D S7^ACHSTXF
 G S5
 ;
RXB ;RE-EXPORT A BATCH
 ;
 S DA=0,P=0,ACHSTXDA=0,ACHSRCT=0
 F  S ACHSTXDA=$O(^ACHSTXST(DUZ(2),1,ACHS("REXNUM"),2,ACHSTXDA)) Q:ACHSTXDA'?1N.N  D
 .S P=$P(^ACHSTXST(DUZ(2),1,ACHS("REXNUM"),2,ACHSTXDA,0),U),DA=$P(^(0),U,2)
 .S (ACHSDOCR,ACHSDOCN,ACHSDOCT,ACHSIPA,ACHSDEST,ACHSCTY,ACHSDR3,ACHSTOS,ACHSDFY,X1)=""
 .S (ACHSXLOC,ACHSCDE,ACHSARCO,ACHSPROV,ACHSFED,ACHSEIN,ACHSDUNS,ACHSCTYP,ACHS2FY)=""
 .Q:'$D(^ACHSF(DUZ(2),"D",P,0))  S ACHSDOCR=^(0)
 .Q:$P(ACHSDOCR,U,3)=2  ;skip special transactions
 .Q:'$D(^ACHSF(DUZ(2),"D",P,"T",DA,0))  S ACHSDOCT=^(0)
 .S ACHSTY=$P(ACHSDOCT,U,2)
 .Q:ACHSTY="ZA"!(ACHSTY="IP")  ;skip paid documents
 .D S7^ACHSTXF
 S ACHSFDT=$P(^ACHSTXST(DUZ(2),1,ACHS("REXNUM"),0),U,2),ACHSLDAT=$P(^(0),U,3)
 G CVTEND1
 ;
AFACERR ;
 W !!,*7,*7,"AUTHORIZING FACILITY CODE ERROR  -  JOB CANCELLED"
 D ^%ZISC,KILL^ACHSTX8
 Q
 ;
CVTEND1 ;
 S ACHSROUT=ACHSRCT
 S:ACHSRCT>2 ACHSROUT=ACHSRCT
 K ACHS2FY,ACHSDEST,ACHSDCR,ACHSF638,ACHSIPA,ACHSCAN,ACHSCDE,ACHSCTY,ACHSDOCN,ACHSDOCR,ACHSEFDT,ACHSPROV,ACHSFED,ACHSSCC,ACHSDOCT,ACHSTY,X1,ACHSXLOC
 G ^ACHSTX3
 ;