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

ACHSTXX.m

Go to the documentation of this file.
  1. ACHSTXX ; IHS/ITSC/PMF - EXPORT DATA (1/9) ; [ 10/16/2001 8:16 AM ]
  1. ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
  1. ;
  1. ; This is the lead program of the export process. You
  1. ;start here whether you are exporting or REexporting
  1. ;
  1. ;Depending on which function you selected, the var ACHSREEX
  1. ;will be set to:
  1. ; 0 exporting
  1. ; 1 reexporting by batch
  1. ; 2 reexporting selected POs
  1. ;
  1. ;
  1. ;set up some special things FOR TESTING ONLY
  1. ;D ^ACHSPMF
  1. S ACHSREEX=0
  1. ;
  1. ;INIT some vars
  1. ;DO a series of checks, any of which may cause us to STOP
  1. ;
  1. ;if we don't stop, then
  1. ; FOR each transaction in the time period
  1. ; if an export record is called for, then
  1. ; create it
  1. ; end for
  1. ; OPEN the unix file
  1. ; FOR each export record created
  1. ; send it to the unix file
  1. ; record it in the database
  1. ; endfor
  1. ; PRINT the export report
  1. ;
  1. ;
  1. ;
  1. D INIT
  1. ;do the checks
  1. ;FOR TEST
  1. ;D ^ACHSTXCK I STOP D END Q
  1. ;get the list to export. go different ways depending on REEX
  1. I ACHSREEX=1 D ^ACHSTX1R
  1. I ACHSREEX=2 D ^ACHSTX2R
  1. I 'ACHSREEX D ^ACHSTX11
  1. ;
  1. ;for testing only
  1. ;W !!,"back from tx11 " R PMF
  1. ;
  1. ;now that the transactions are created, bring them all into one
  1. ;global and send them.
  1. ;
  1. D END
  1. Q
  1. ;
  1. END ;
  1. ;we've come to the end of the job. maybe we completed the
  1. ;export, maybe we didn't. The value in tag STOP will tell
  1. ;us.
  1. ;
  1. ;if stop is true, do special stuff
  1. I STOP D STOP
  1. ;now do the stuff we do if stop is true or not
  1. ;
  1. X:$D(ACHSPCC) ACHSPPC
  1. U IO(0)
  1. ;
  1. ;for test
  1. ;I $$DIR^XBDIR("E","Press RETURN...")
  1. I '$$LOCK^ACHS("^ACHSF(DUZ(2),""D"")","-")
  1. K %DT,ACHSCRTN,DA,DFN,DIC,DIE,DOLRH,DR,DUOUT,DX,DY,LIST,NUM
  1. K OK,RET,ROUT,STOP,TNUM,VNDEINSX,W,X,X1,XBDT,XBF,XBGL,XBTIT,Y,Z
  1. D EN^XBVK("ACHS"),^%ZISC,^ACHSVAR
  1. ;
  1. ;for test
  1. D ^ACHSR1
  1. Q
  1. ;
  1. STOP ;
  1. I STOP=1 W !,"User terminated this function - no export performed"
  1. I STOP=2 W !,"Register not closed"
  1. I STOP=3 W !,"Authorizing facility number invalid"
  1. I STOP=4 W !,"No data for facility"
  1. I STOP=5 W !,"DHR record not 80 chars"
  1. ;
  1. W !,"Abnormal end of function"
  1. ;
  1. ;any abnormal end means no export happened. this line
  1. ;cleans out the record of it.
  1. I $G(DOLRH)'="" K ^ACHSXPRT(DOLRH)
  1. ;
  1. Q
  1. ;
  1. INIT ;
  1. D ^ACHSVAR
  1. D ^ACHSUF
  1. D LINES^ACHSFU
  1. ;
  1. S ACHSYAYA="" F S ACHSYAYA=$O(^ACHSXPRT(ACHSYAYA)) Q:ACHSYAYA="" K ^ACHSXPRT(ACHSYAYA)
  1. K ACHSYAYA
  1. ;
  1. S STOP=0
  1. S ACHSRCT=0,ACHSCRTN=""
  1. S ACHSF638=($$PARM^ACHS(0,8)="Y")
  1. S DOLRH=$TR($H,",","_")
  1. K DUOUT,DTOUT
  1. Q