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

ACHSTX2R.m

Go to the documentation of this file.
  1. ACHSTX2R ; IHS/ITSC/PMF - EXPORT DATA. reexport selected documents
  1. ;;3.1;CONTRACT HEALTH MGMT SYSTEM;;JUN 11, 2001
  1. ;
  1. ;we get here if we are reexporting POs specified by the user.
  1. ;
  1. ;same initialization as exporting for the first time
  1. D INIT^ACHSTX11 I STOP Q
  1. ;
  1. ; Select transactions from particular documents for export.
  1. KILL ^TMP("ACHSTXAR",$J)
  1. NEW D,T
  1. F D ^ACHSUD Q:$D(DUOUT)!$D(DTOUT)!'$D(ACHSDIEN) D SELDOC Q:%=11
  1. ;
  1. K ACHSDIEN
  1. I $$DIR^XBDIR("E")
  1. ;
  1. ;Now, if we have transactions, call them up one by one and
  1. ;examine them. Use the same code path used for exporting
  1. ;for the first time.
  1. ;
  1. ;
  1. S ACHSDATE="" F S ACHSDATE=$O(^TMP("ACHSTXAR",$J,ACHSDATE)) Q:ACHSDATE="" D
  1. . S ACHSDIEN="" F S ACHSDIEN=$O(^TMP("ACHSTXAR",$J,ACHSDATE,ACHSDIEN)) Q:ACHSDIEN="" D
  1. .. S ACHSTY="" F S ACHSTY=$O(^TMP("ACHSTXAR",$J,ACHSDATE,ACHSDIEN,ACHSTY)) Q:ACHSTY="" D
  1. ... ;we use var DA for the next level so that it matchs what
  1. ... ;the main export code does
  1. ... S DA="" F S DA=$O(^TMP("ACHSTXAR",$J,ACHSDATE,ACHSDIEN,ACHSTY,DA)) Q:DA="" D
  1. .... S ACHSDOCN=^TMP("ACHSTXAR",$J,ACHSDATE,ACHSDIEN,ACHSTY,DA)
  1. .... D ^ACHSDOCR I 'OK Q
  1. .... D ^ACHSVNDR I 'OK Q
  1. .... S ACHSCTY=ACHSTY
  1. .... D EXTR4^ACHSTX11
  1. .... Q
  1. ... Q
  1. .. Q
  1. . Q
  1. Q
  1. ;
  1. SELDOC ;
  1. ;now that we have a pointer to a document, ACHSDIEN, lets pick
  1. ;what transaction we want.
  1. ;
  1. S ACHSDOCR=$G(^ACHSF(DUZ(2),"D",ACHSDIEN,0))
  1. I ACHSDOCR="" W !!,"Invalid PO" Q
  1. S ACHSDOCN="0"_$P(ACHSDOCR,U,14)_ACHSFC_$E($P(ACHSDOCR,U)+100000,2,6)
  1. ;The SELTRANS module returns these vars set for this doc and trans:
  1. ;ACHSDATE date of the transaction activity
  1. ;ACHSTY transaction type
  1. ;T transaction number
  1. ;
  1. S T=$$SELTRANS(ACHSDIEN)
  1. I $D(DUOUT)!$D(DTOUT)!'T S %=11,STOP=1 Q
  1. ;
  1. ;if they asked to remove a selection, do so
  1. ;else set the transaction into the list
  1. I $P(T,U,2)="-" S T=$P(T,U,1) KILL ^TMP("ACHSTXAR",$J,ACHSDATE,ACHSDIEN,ACHSTY,T)
  1. E S ^TMP("ACHSTXAR",$J,ACHSDATE,ACHSDIEN,ACHSTY,T)=ACHSDOCN
  1. S (%,ACHSSDI)=0
  1. ;
  1. W !!,"The list now consists of the following transactions:"
  1. F S ACHSSDI=$O(^TMP("ACHSTXAR",$J,ACHSSDI)) Q:'ACHSSDI S D=0 F S D=$O(^TMP("ACHSTXAR",$J,ACHSSDI,D)) Q:'D D
  1. . S ACHSTYP="" F S ACHSTYP=$O(^TMP("ACHSTXAR",$J,ACHSSDI,D,ACHSTYP)) Q:ACHSTYP="" S T=0 F S T=$O(^TMP("ACHSTXAR",$J,ACHSSDI,D,ACHSTYP,T)) Q:'T D
  1. .. S ACHSDOCN=^TMP("ACHSTXAR",$J,ACHSSDI,D,ACHSTYP,T)
  1. .. S %=%+1
  1. .. W !,$J(%,2),". ",$P(^ACHSF(DUZ(2),"D",D,0),U,14),"-",$$FC^ACHS(DUZ(2)),"-",$P(^ACHSF(DUZ(2),"D",D,0),U,1)
  1. .. D DISTRANS(D,T)
  1. .. Q
  1. . Q
  1. ;
  1. I %=10 S %=11
  1. Q
  1. ;
  1. SELTRANS(D) ; Display trans of doc D, and allow selection.
  1. D HELP("H1")
  1. NEW C,T
  1. W !!?10,"----------------------------------------------------",!?10,"TRANS",?30,"TRANS",!?11,"NUM",?19,"D A T E",?30,"TYPE",?40,"AMOUNT",!?10,"----------------------------------------------------",!!
  1. S (C,T)=0
  1. F S T=$O(^ACHSF(DUZ(2),"D",D,"T",T)) Q:+T=0 S Y=^(T,0),C=C+1,C(C)=T W !?10,$J(C,3) D DISTRANS(D,T)
  1. ;
  1. S Y=$$DIR^XBDIR("N^-"_C_":"_C,"Re-export which transaction","1","","Enter the number corresponding to the transaction you want re-exported","^D HELP^ACHSTXAR(""H1"")",2)
  1. ;
  1. Q:$D(DUOUT)!$D(DTOUT)!(Y=0) 0
  1. I Y<1 Q C(-1*Y)_"^-"
  1. Q C(Y)
  1. ;
  1. DISTRANS(D,T) ;
  1. S Y=^ACHSF(DUZ(2),"D",D,"T",T,0)
  1. S ACHSDATE=$P(Y,U,1),ACHSTY=$P(Y,U,2)
  1. W ?17,$$FMTE^XLFDT(ACHSDATE),?32,ACHSTY,$P(Y,U,5),?35,$J($FN($P(Y,U,4),",",2),11)," <",$$EXTSET^XBFUNC(9002080.02,1,$P(Y,U,2)),">"
  1. Q
  1. ;
  1. HELP(L) ;EP - Display text at label L.
  1. W !
  1. F %=1:1 W !?4,$P($T(@L+%),";",3) Q:$P($T(@L+%+1),";",3)="###"
  1. Q
  1. ;
  1. H ;
  1. ;;Selection of individual documents is intended to allow the local
  1. ;;service unit to clear documents that are not processing at higher
  1. ;;levels.
  1. ;;
  1. ;;E.g., if an FI document is PEND'ing for no obligation (P259), the
  1. ;;S.U. may want to selectively re-export the initial obligation
  1. ;;transaction of the document.
  1. ;;
  1. ;;Or, if the HAS is still showing an IHS document as open after a
  1. ;;reasonable amount of time has lapsed, the S.U. may want to
  1. ;;selectively re-export the pay.
  1. ;;
  1. ;;( "ZA" and "IP" transactions are not exported. )
  1. ;;###
  1. ;
  1. ;
  1. H1 ;
  1. ;;Enter a number corresponding to the transaction that you want to re-export.
  1. ;;Enter a "-" before the number to remove the transaction from the list.
  1. ;;###
  1. ;