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

PRCPDAPE.m

Go to the documentation of this file.
  1. PRCPDAPE ;WISC/RFJ-drug accountability/prime vendor (errors) ;15 Mar 94
  1. ;;5.1;IFCAP;;Oct 20, 2000
  1. ;Per VHA Directive 10-93-142, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. NONTYPE ; check for order of buyer, seller, ship
  1. I NTYPE="" D ERROR("THE IDENTIFIER SEGMENT 'N1' NEEDS TO COME BEFORE THE '"_$P(DATA,"^")_"' SEGMENT")
  1. Q
  1. ;
  1. ;
  1. ERROR(MSG) ; show error
  1. W !,DATA
  1. K X S X(1)=MSG D DISPLAY^PRCPUX2(1,79,.X)
  1. S PRCPFLAG=1
  1. Q
  1. ;
  1. ;
  1. ORDER ; check order of code sheets
  1. ; isa <--------------+
  1. ; gs <----------+ |
  1. ; st <------+ | |
  1. ; | big | | |
  1. ; | it1 <--+ | | |
  1. ; | ... | | | |--repeats
  1. ; | it1 <--+ | | |
  1. ; | ctt | | |
  1. ; se <------+ | |
  1. ; ge <----------+ |
  1. ; iea <--------------+
  1. S NEXTSEG=$P(DATA,"^")
  1. I LASTSEG="",NEXTSEG'="ISA" D ORDERROR("",NEXTSEG,"ISA") Q
  1. I LASTSEG="GE",NEXTSEG="GS" Q
  1. I LASTSEG="GE",NEXTSEG'="IEA" D ORDERROR("GE",NEXTSEG,"IEA") Q
  1. ;
  1. I LASTSEG="ISA",NEXTSEG'="GS" D ORDERROR("ISA",NEXTSEG,"GS") Q
  1. I LASTSEG="SE",NEXTSEG="ST" Q
  1. I LASTSEG="SE",NEXTSEG'="GE" D ORDERROR("SE",NEXTSEG,"GE") Q
  1. ;
  1. I LASTSEG="GS",NEXTSEG'="ST" D ORDERROR("GS",NEXTSEG,"ST") Q
  1. I LASTSEG="CTT",NEXTSEG'="SE" D ORDERROR("CTT",NEXTSEG,"SE") Q
  1. ;
  1. I LASTSEG="ST",NEXTSEG'="BIG" D ORDERROR("ST",NEXTSEG,"BIG") Q
  1. ;
  1. I LASTSEG="IT1",NEXTSEG="IT1" Q
  1. I LASTSEG="IT1",NEXTSEG'="CTT" D ORDERROR("IT1",NEXTSEG,"CTT") Q
  1. Q
  1. ;
  1. ;
  1. ORDERROR(LAST,NEW,EXPECT) ; segments out of order
  1. ; isa segment should be first
  1. I LAST="" D ERROR("SEGMENTS OUT OF ORDER, THE STARTING SEGMENT SHOULD BE 'ISA', NOT '"_NEW_"'") Q
  1. ; segments other than isa
  1. D ERROR("SEGMENTS OUT OF ORDER, THE SEGMENT FOLLOWING '"_LAST_"' SHOULD BE '"_EXPECT_"', NOT '"_NEW_"'") Q
  1. Q