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

ACHSACO1.m

Go to the documentation of this file.
ACHSACO1 ; IHS/ITSC/TPF/PMF - AREA CONSOLIDATION (2/3) ;
 ;;3.1;CONTRACT HEALTH MGMT SYSTEM;**13,23**;JUN 11,2001;Build 43
 ;ACHS*3.1*13 6.14.2007 IHS/OIT/FCJ ADDED UFMS REC TO REC SUB, REC COUNTER AND TOT
 ;
A1 ; Initialize counters, main process loop.
 ;ACHS*3.1*13 IHS/OIT/FCJ ADD UFMS COUNTER IN 2 LINES NXT LINE;ACHS*3.1*23 ADD STAT ICD10 COUNTER
 S ACHSCT=+^ACHSPCC("COUNT"),(ACHSCTV,ACHSCTFI,ACHSCTFS,ACHSCTPG,ACHSCTP2,ACHSCTPD,ACHSCTUF)=0
 F ACHS=2:1:7,"U" S ACHSTOTL(ACHS)=0
 S ACHSCTFI=$G(^ACHSZOCT("BCBS"))
 S ACHSCTPD=$G(^ACHSZOCT("AOPD"))
 S ACHSCTV=+$P($G(^ACHSAOVU(0)),U)
 S ACHSCTPG=$G(^ACHSZOCT("PIG"))
 S ACHSCTPG=$G(^ACHSPIG(0,0))
 S ACHSCTP2=$G(^ACHSPG2(0,0))  ;ACHS*3.1*23
 S ACHSCCOR=$G(^ACHSCORE("COUNT"))
 S ACHSCTUF=$G(^ACHSUFMS("COUNT"))  ;ACHS*3.1*13 6.14.2007 IHS/OIT/FCJ ADDED COUNTER FOR UFMS REC
 S ACHSCTUA=$G(^ACHSUFMS(0))  ;ACHS*3.1*13 6.14.2007 IHS/OIT/FCJ ADDED COUNTER FOR UFMS $
 S ACHSCCOR("P")=$$AOP^ACHS(2,2)
 U IO(0)
 ;
 W !,"Transferring ",$P(ACHSXD2,U,7)," CHS Data Records..."
 W !,"From ",$P($P(IOPAR,":"),"(",2),!!
 S DX=$X,DY=$Y
 S ACHSCTVS=ACHSCTV+1
 ;
 ;adding new var TCOUNT for transaction count.  1/4/01  pmf
 ;F  D  Q:$E(X)="*"
 F TCOUNT=1:1 D  Q:$E(X)="*"
 .U IO
 .R X:300
 .Q:$E(X)="*"                   ;REACHED EOF MARK -GOOD FILE
 .R ACHSX2:300
 .;I '($E(ACHSX2)) Q             ;ACHS*3.1*13 IHS/OIT/FCJ COMMENTED OUT TO READ "U" TYPE REC
 .D T
 .S X=+$P($P(X,"(",2),")")      ;
 .;
 .;the next couple of lines is supposed to tell them when
 .;every 10 records have been transferred, with a little
 .;fancy video stuff.  however, the value of X may not be
 .;what we need it to be, and the IOXY execution is not
 .;working at all, so I'm replacing it.
 .;keep these comments until the end of beta testing, just
 .;so we keep track of what's going on.  1/4/01  pmf
 .;I '(X#10) U IO(0) W X X IOXY
 .I TCOUNT#10=0 U IO(0) W TCOUNT,"   "
 ;
 ;REACHED END OF FILE WITH NO BAD RECORDS
 D END^ACHSACO2
 Q
 ;
 ;
T ;
 ;S ACHSRTYP=+$E(ACHSX2)                           ;RECORD TYPE
 S ACHSRTYP=$E(ACHSX2)                           ;RECORD TYPE ACHS*3.1*13 IHS/OIT/FCJ Removed "+" TO READ "U" TYPE REC
 S ACHSTOTL(ACHSRTYP)=ACHSTOTL(ACHSRTYP)+1        ;COUNT OF RECORD TYPES
 S:'$D(ACHSZFAC(ACHSFCPT)) ACHSZFAC(ACHSFCPT)=0          ;FACILITY COUNT
 S $P(ACHSZFAC(ACHSFCPT),U)=$P(ACHSZFAC(ACHSFCPT),U)+1
 ;
 ;
 D T2:ACHSRTYP=2          ;FACILITY GENERATED DHR RECORD
                          ;INCLUDES 638 DENTAL RECORD FOR NPIRS
                          ; BEGINNING WITH '25'
                          ;
 D T3:ACHSRTYP=3          ;PATIENT RECORD. INCLUDES 3A, 3B
                          ;AND 3C THIRD PARTY COVERAGE
                                 ; 
 D T4:ACHSRTYP=4          ;VENDOR RECORD. INCLUDES 4A AND 4B
                          ;
 D T5:ACHSRTYP=5          ;DOCUMENT (PURCHASE ORDER) RECORD
                          ;INCLUDES 5A AND 5B
                          ;
 D T6:ACHSRTYP=6          ;PAYMENT RECORD FOR AREA OFFICE
                          ;INCLUDES 6A AND 6B
                          ;
 D T7:ACHSRTYP=7          ;638 STATISTICAL RECORDS FOR NPIRS
                          ;INCLUDES 7A AND 7B
 D TU:ACHSRTYP="U"        ;UFMS RECORD ;ACHS*3.1*13 IHS/OIT/FCJ Added for UFMS REC
 ;
 ;ACHS*3.1*13 IHS/OIT/FCJ ADDED "U" TO NXT LINE
 ;F ACHSJ=2:1:7 S:ACHSTOTL(ACHSJ)>0 ACHSZFAC(ACHSFCPT,ACHSDRUN,ACHSJ)=ACHSTOTL(ACHSJ)
 F ACHSJ=2:1:7,"U" S:ACHSTOTL(ACHSJ)>0 ACHSZFAC(ACHSFCPT,ACHSDRUN,ACHSJ)=ACHSTOTL(ACHSJ)
 Q
 ;
T2 ; FACILITY GENERATED DHR records for HAS and/or CORE.
 ; For HAS
 D  ; ALWAYS CREATE THE ACHSPCC GLOBAL FOR TRANSMISSION
 . N ACHSSRTY
 .;IF SECOND CHAR IS "B" OR "C" THEN OKAY
 .;OTHERWISE SET NULL
 .S ACHSSRTY=$S("BC"[$E(ACHSX2,2):$E(ACHSX2,2),1:"")
 .;I HAVE SEEN THE SECOND CHAR AS A "5" AND A "0"
 . I ACHSSRTY="" S ACHSHR1=ACHSX2     ;"20" ????? AND "25" DENTAL RECORDS
 .;
 . I ACHSSRTY="B" S ACHSHR2=ACHSX2
 .;
 . I ACHSSRTY="C" D
 .. S ACHSCT=ACHSCT+1
 .. S ^ACHSPCC(ACHSFACD,ACHSCT)=$$CORE(1)
 .. S ACHSCT=ACHSCT+1
 .. S ^ACHSPCC(ACHSFACD,ACHSCT)=$$CORE(2)
 . S ^ACHSPCC("COUNT")=ACHSCT
 ;
 ; For CORE
 ;I ACHSCCOR("P")'="HAS" S ACHSCCOR=ACHSCCOR+1,^ACHSCORE(ACHSFACD,ACHSCCOR)=ACHSX2,^ACHSCORE("COUNT")=ACHSCCOR
 Q
 ;
T3 ;
 ;IF WE SHOULD PROCESS FI DATA AND THERE ARE FACILITIES EXPORTING FI DATA
 ;'PROCESS FI DATA'      'FACILITIES EXPORTING FI DATA'
 Q:$$AOP^ACHS(2,3)'="Y"!('$D(^ACHSAOP(DUZ(2),20,ACHSFCPT)))
 S ACHSCTFI=ACHSCTFI+1,^ACHSBCBS(ACHSCTFI)=ACHSX2
 Q
 ;
T4 ;
 ;CHECK TO SEE IF WE SHOULD PROCESS 3RD PARTY COVERAGE TO FI AND WHERE
 ;'PROCESS FI DATA'       'FACILITIES EXPORTING FI DATA'
 G T4A:$$AOP^ACHS(2,3)'="Y"!('$D(^ACHSAOP(DUZ(2),20,ACHSFCPT)))
 S ACHSCTFI=ACHSCTFI+1,^ACHSBCBS(ACHSCTFI)=ACHSX2
T4A ;
 ;CHECK TO SEE IF WE SHOULD PROCESS AREA OFFICE DATA 
 ;'PROCESS AREA OFFICE DATA'
 Q:$$AOP^ACHS(2,4)'="Y"
 S ACHSCTV=ACHSCTV+1,^ACHSAOVU(ACHSCTV)=ACHSX2
 Q
 ;
T5 ;'PROCESS FI DATA'    'FACILITIES EXPORTING FI DATA'
 I $$AOP^ACHS(2,3)="Y",$D(^ACHSAOP(DUZ(2),20,ACHSFCPT)) S ACHSCTFI=ACHSCTFI+1,^ACHSBCBS(ACHSCTFI)=ACHSX2
 D SVRSUB:$D(^ACHSAOP(DUZ(2),21))  ;IF 'SPECIAL REPORT VENDORS'
 Q
 ;
T6 ;'PROCESS AREA OFFICE DATA'
 Q:$$AOP^ACHS(2,4)'="Y"
 S ACHSCTPD=ACHSCTPD+1,^ACHSAOPD(ACHSCTPD)=ACHSX2
 Q
 ;
T7 ; Statistical records.
 ;ACHS*3.1*23 ADDED TEST FOR NEW STAT RECORD.
 I ACHSSTV="CRV003" D
 .S ACHSCTP2=ACHSCTP2+1
 .I $E(ACHSX2,1,2)="7A" S ACHSSTYP=$E(ACHSX2,3,4)
 .S ^ACHSPG2(ACHSSTYP,ACHSFACD,ACHSCTP2)=ACHSX2
 E  D
 .S ACHSCTPG=ACHSCTPG+1
 .I $E(ACHSX2,1,2)="7A" S ACHSSTYP=$E(ACHSX2,3,4)
 .S ^ACHSPIG(ACHSSTYP,ACHSFACD,ACHSCTPG)=ACHSX2
 Q
TU ; UFMS Record ;ACHS*3.1*13 IHS/OIT/FCJ ADDED FOR PROCESSING UFMS RECORD
 Q:$E(ACHSX2,1,2)'="U2"
 S ACHSCTUF=ACHSCTUF+1
 S ^ACHSUFMS(ACHSCTUF)=$E(ACHSX2,2,161)
 S ACHSCTUA=ACHSCTUA+$E(ACHSX2,53,64)
 Q
 ;
SVRSUB ; Generate ^ACHSSVR global from 5A & 5B records.
 G SVR5A:$E(ACHSX2,1,2)="5A",SVR5B:$E(ACHSX2,1,2)="5B"
 Q
 ;
SVR5A ;
 K ACHSX3
 S DIC="^AUTTVNDR(",DIC(0)="M",D="C",X=$E(ACHSX2,22,33)
 I $E(X,11,12)="  " S X=$E(X,1,10)
 D ^DIC
 Q:Y<1
 Q:'$D(^ACHSAOP(DUZ(2),21,"B",+Y))
 S ACHSX3=ACHSX2
 S ACHSZFAC=$E(ACHSX2,15,20)
 S ACHSEIN=$E(ACHSX2,22,33)
 S:$E(ACHSEIN,11,12)="  " ACHSEIN=$E(ACHSEIN,1,10)
 S ACHSCTFS=ACHSCTFS+1
 S ^ACHSSVR(ACHSEIN,ACHSZFAC,ACHSCTFS)=ACHSX3
 Q
 ;
SVR5B ;
 Q:'$D(ACHSX3)
 S ACHSX4=ACHSX2
 S ^ACHSSVR(ACHSEIN,ACHSZFAC,ACHSCTFS)=ACHSX3_ACHSX4
 Q
 ;
REC(X) ;EP - Return the name of the export record, 1-8.
 ;CALLED BY ACHSACO2+9 AT END OF REPORT
 ;ALSO CALLED BY:
 ;              ACHSTX3+4,ACHSTX4+4,ACHSTX5+4,ACHSTX6+4,ACHSTX7+35
 ;              ACHSTX8+6
 Q:'$G(X) ""
 ;ACHS*3.1*13 IHS/OIT/FCJ ADDED UFMS REC TO REC SUB
 Q $P("NOT USED^DHR RECORDS FOR HAS/CORE^PATIENT RECORDS FOR AO/FI^VENDOR RECORDS FOR AO/FI^DOCUMENT RECORDS FOR AO/FI^PAYMENT RECORDS FOR AO^STATISTICAL RECORDS^UFMS RECORDS",U,X)
 ;
 ;BEGIN CORE MODIFICATIONS ADDITIONAL CODE
CORE(R) ;PROCESS A '2B' RECORD INTO THE 80-160 '2' PART TWO RECORD
 I R=1 D
 . S ACHSEIN=$E(ACHSX2,3,14)
 . S R=$E(ACHSHR1,1,64)_$E(ACHSEIN_$J("",15),1,15)_" "
 I R=2 D
 . S ACHSF12=$E(ACHSHR2,59,60)                       ;FISCAL YEAR
 . S ACHSF10=$E(ACHSHR2,61,64)                       ;BEGIN DATE
 . S ACHSF11=$E(ACHSHR2,65,68)                       ;END DATE
 . S R=$J("",45)_ACHSF10_ACHSF11_ACHSF12_$J("",25)
 . S R=$E(R,1,60)_$$REPEAT^XLFSTR("9",20)            ;REQUIRED BY HAS
 Q R
 ;END CORE MODIFICATIONS ADDITIONAL CODE