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

ACHSTXA1.m

Go to the documentation of this file.
ACHSTXA1 ; IHS/ITSC/PMF - EXPORT DATA - RECORD 2(DHR), SPECIFIC RE-EXPORTS ;  [ 11/26/2003  8:04 AM ]
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**7,14,16**;JUNE 11,2001
 ;ITSC/SET/JVK ACHS*3.1*7 - TEST FOR NO E-SIG
 ; This routine was created from ACHSTX2, for use with exporting 
 ; specifically selected document transactions.  If any change in logic
 ; is made to ACHSTX2, the change should also be made to this routine.
 ;ACHS*3.1*16 10/15/2009 IHS.OIT.FCJ FX FY 2 DIG YEAR PROBLEM
 ;
 D LINES^ACHSFU
 W @IOF,!,$$REPEAT^XLFSTR("*",80),!,$$C^XBFUNC("RE-EXPORT SELECTED CHS DATA"),!,$$REPEAT^XLFSTR("*"),!
 S ACHSCHSS=""
 D ^ACHSUF
 K ACHSCHSS
 D KILLGLBS^ACHSTX
 S (J,ACHSDCR,ACHSEDT,ACHSBDT)=0,ACHSRR="",ACHSF638=$$PARM^ACHS(0,8)
 F ACHS=2:1:7 S ACHSRTYP(ACHS)=0
 W !?10,"FACILITY NAME: ",$$LOC^ACHS
 S ACHSBDT=0,ACHSEDT=3990000
S2 ;
 G ERR:ACHSEDT=0
 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(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ACHSDEST
S7 ;
 ;ITSC/SET/JVK ACHS*3.1*7 CMT OUT NXT 1
 ;I ACHSDEST="F"!(ACHSTY'="P") G S8
 I $$PARM^ACHS(2,9)'="Y" G S7A
 S ^ACHSTXPG(ACHSTOS,ACHSDIEN,ACHSTIEN)=""
S7A ;
 I ACHSF638'="Y" G S8
 S:'$P(ACHSDOCR,U,3) ^ACHSTXPG(ACHSTOS,ACHSDIEN,ACHSTIEN)=""
 ;ACHS*3.1*14 IHS/OIT/FCJ Commented out next line because some 638 sites send FI data
 ;G S5
S8 ;
 G S5:ACHSTY="P"
 ;ITSC/SET/JVK ACHS*3.1*7 11/26/2003 CMT NXT 1
 ;G S5:(ACHSESIG="")&(ACHSBDT>ACHSADT)
 I ACHSF638="Y",$$PARM^ACHS(2,9)="Y" G S5
 S ^ACHSTXOB(ACHSDIEN,ACHSTIEN)=""
 ;
 I +$P(ACHSDOCR,U,22),+$P(ACHSDOCR,U,20),+$P(ACHSDOCR,U,21) S ^ACHSTXPT(+$P(ACHSDOCR,U,22),+$P(ACHSDOCR,U,20),+$P(ACHSDOCR,U,21))=ACHSDEST
 ;
 S (ACHSX,X1)=$P(ACHSDOCR,U,14)
 D FYCVT^ACHSFU
 S ACHSXLOC=ACHSFC
 S:ACHSY<1987 ACHSXLOC="0"_$E(ACHSFC,2,3)
 S ACHSEFDT=$E(DT,4,5)_$E(DT,6,7)_$E(DT,2,3),ACHSCDE=$S(ACHSCTY="I":"05013",ACHSCTY="F":"05024",ACHSCTY="P":"05025",ACHSTY="S":"05015",1:"")
 ;ACHS*3.1*16 10/15/2009 IHS.OIT.FCJ ADDED CORRECT FY
 ;S ACHSDOCN=0_X1_ACHSXLOC_$P(ACHSDOCR,U)
 S ACHSDOCN=$E($P(ACHSDOCR,U,27),3,4)_ACHSXLOC_$P(ACHSDOCR,U)
 S:'$D(^ACHSTXVN(ACHSPROV)) ^ACHSTXVN(ACHSPROV)=ACHSDEST
 ;
 G ERROR^ACHSTX:ACHSCDE=""
 D CANOBJ^ACHSTX8
 S ACHSFED=$S($P(^AUTTVNDR(ACHSPROV,11),U,10)=2:2,1:1)
 S ACHSRCT=ACHSRCT+1,ACHSRTYP(2)=ACHSRTYP(2)+1
 S ^ACHSDATA(ACHSRCT)="2"_ACHSEFDT_ACHSCDE_$S(ACHSTOS=1:323,ACHSTOS=2:324,ACHSTOS=3:325,1:"")_ACHSDOCN_$J("",13)_"1"_X1_ACHSCAN_ACHSOBJC_ACHSIPA_ACHSFED_$J("",16)
 I $L(^ACHSDATA(ACHSRCT))'=80 W !!,*7,*7,"A DHR RECORD WAS PRODUCED THAT WAS NOT 80 CHARACTERS IN LENGTH:",!!,^(ACHSRCT),!,*7,*7 G ERROR^ACHSTX
 I ACHSRCT=1 S ACHSFDT=ACHSBDT W !!,"NUMBER OF RECORDS PROCESSED = ",!!
 W $J(ACHSRCT,8)
 D BC^ACHSTX2
 G S5
 ;
ERR ;
 W !!,*7,*7,"DCR REGISTER ERROR YOU MUST CLOSE YOUR REGISTERS FIRST"
 D ^%ZISC,KILL^ACHSTX8
 Q
 ;
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 ACHSDEST,ACHSDCR,ACHSF638,ACHSIPA,ACHSCAN,ACHSCDE,ACHSCTY,ACHSDOCN,ACHSDOCR,ACHSEFDT,ACHSPROV,ACHSFED,ACHSSCC,ACHSTRNR,ACHSTY,X1,ACHSXLOC
 G ^ACHSTX3
 ;