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

RCDPEX0.m

Go to the documentation of this file.
  1. RCDPEX0 ;ALB/TMK - 837 EDI RETURN MSG EXTRACT MAIN LIST TEMPLATE ;02-MAY-96
  1. ;;4.5;Accounts Receivable;**173**;Mar 20, 1995
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. SCRIT(RCSCRIT) ; Enter display selection criteria
  1. ; Pass RCSCRIT by reference - returned containing selection criteria
  1. ; RCSCRIT(n)=n-level sort RCSCRIT(n,1-x)=selections
  1. ; RCSCRIT(n,"D1") = from DATE range RCSCRIT(n,"D2") = to DATE range
  1. N DIR,X,Y
  1. D FULL^VALM1
  1. W !
  1. S DIR("B")="ALL"
  1. S DIR("A",1)="Enter sort and selection criteria for message list",DIR("A",2)=" ",DIR("A")="First level sort field: "
  1. S DIR(0)="SA^MT:TYPE OF MESSAGE;ER:TYPE OF ERROR;ALL:ALL MESSAGES"
  1. S DIR("?")="Enter the top-level sort for the list of messages"
  1. D ^DIR K DIR
  1. I $D(DIRUT) K RCSCRIT Q
  1. S RCSCRIT(1)=Y
  1. I Y="ALL" Q
  1. D SELECT(1,.RCSCRIT) Q:'$D(RCSCRIT)
  1. S DIR("A",1)=" ",DIR("A")="Second level sort field: "
  1. S DIR(0)="SAO^"_$S($S(RCSCRIT(1)'="MT":"MT:TYPE OF MESSAGE;",1:"")_RCSCRIT(1)'="MS":"ER:TYPE OF ERROR;",1:"")_"MD:ERA MESSAGE DATE;RD:ERA RECORDED DATE"
  1. S DIR("?")="Enter the second-level sort for the list of messages"
  1. S DIR("?",1)="First level sort selected was: "_$$FLD(RCSCRIT(1))
  1. D ^DIR K DIR
  1. I $D(DTOUT)!$D(DUOUT) K RCSCRIT Q
  1. I Y="" Q
  1. S RCSCRIT(2)=Y
  1. D SELECT(2,.RCSCRIT) Q:'$D(RCSCRIT)
  1. S DIR("A",1)=" ",DIR("A")="Third level sort field: "
  1. S DIR(0)="SAO^"
  1. S DIR(0)=DIR(0)_$S(RCSCRIT(1)'="MT"&(RCSCRIT(2)'="MT"):"MT:TYPE OF MESSAGE;",1:"")_$S(RCSCRIT(1)'="ER"&(RCSCRIT(2)'="ER"):"ER:TYPE OF ERROR",1:"")
  1. S DIR(0)=DIR(0)_$S(RCSCRIT(2)'="MD":"MD:ERA MESSAGE DATE;",1:"")_$S(RCSCRIT(2)'="RD":"RD:ERA RECORDED DATE",1:"")
  1. S DIR("?")="Enter the third-level sort for the list of messages"
  1. D ^DIR K DIR
  1. I $D(DTOUT)!$D(DUOUT) K RCSCRIT Q
  1. I Y="" Q
  1. S RCSCRIT(3)=Y
  1. D SELECT(3,.RCSCRIT)
  1. Q
  1. ;
  1. SELECT(LEVEL,RCSCRIT) ; Select specific or all values/date range for RCSCRIT(LEVEL)
  1. ; LEVEL = sort level 1-3
  1. N SELNM,SEL,CT,Y,DIR,DUOUT,DTOUT,DIRUT,X,Z
  1. S SEL=$G(RCSCRIT(LEVEL)) I SEL="" K RCSCRIT Q
  1. S SELNM=$$FLD(SEL)
  1. RESEL S DIR("A")="Do you want ALL "_SELNM_"'s",DIR(0)="Y",DIR("?")="ANSWER YES TO INCLUDE ALL "_SELNM_" OR NO TO SELECT SPECIFIC VALUES OR RANGES"
  1. D ^DIR K DIR
  1. I $D(DIRUT) K RCSCRIT Q
  1. I Y=1 Q
  1. I SEL="MD"!(SEL="RD") D Q ;Date field
  1. . S DIR("A")="From Date: ",DIR(0)="DA^:"_DT_":P",DIR("?")="Enter the earliest date you want included in the list" D ^DIR
  1. . I $D(DIRUT) K RCSCRIT Q
  1. . S RCSCRIT(LEVEL,"D1")=Y I 'X W " ",$$FMTE^XLFDT(Y,2)
  1. . S DIR("A")="To Date: ",DIR(0)="DA^:"_DT_":P",DIR("?")="Enter the latest date you want included in the list" D ^DIR
  1. . I $D(DIRUT) K RCSCRIT Q
  1. . S RCSCRIT(LEVEL,"D2")=Y I 'X W " ",$$FMTE^XLFDT(Y,2)
  1. S CT=0
  1. S DIR("A",1)=" ",DIR("A",2)="Enter your selections one at a time.",DIR("A",3)="When done, press return at the "_SELNM_" prompt to continue."
  1. S DIR("A")=SELNM_": ",DIR(0)=$S(SEL="ER":"344.5,.1",SEL="MT":"344.5,.02",1:"")_"AO"
  1. F D ^DIR D Q:"^"[Y
  1. . Q:$D(DUOUT)
  1. . I Y="" Q:CT W !,*7,"You must select at least one entry" S Y=-1 Q
  1. . S CT=CT+1,RCSCRIT(LEVEL,$P(Y,U))=Y
  1. . I $D(DIR("A",1)) F Z=1:1:3 K DIR("A",Z)
  1. K DIR
  1. I $D(DUOUT)!$D(DTOUT) D I $D(RCSCRIT) K RCSCRIT(LEVEL) S RCSCRIT(LEVEL)=SEL G RESEL
  1. . S DIR(0)="Y",DIR("A",1)=" ",DIR("A")="Do you want to abort this entire sort/selection"
  1. . S DIR("?")="Answer YES if you want to abort or to re-enter all sort/selection criteria",DIR("?",1)="Answer NO if you want to re-enter just this sort level's criteria"
  1. . D ^DIR K DIR
  1. . I $D(DIRUT)!Y K RCSCRIT
  1. Q
  1. ;
  1. FLD(FLD) ; RETURN NAME OF FIELD
  1. Q $S(FLD="ER":"ERROR CATEGORY",FLD="MT":"TYPE OF MESSAGE",FLD="MD":"MESSAGE DATE",FLD="RD":"DATE RECORDED",1:"")
  1. ;