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

BPSJVAL.m

Go to the documentation of this file.
  1. BPSJVAL ;BHAM ISC/LJF - Pharmacy data entry ;2004-03-01
  1. ;;1.0;E CLAIMS MGMT ENGINE;**1,2**;JUN 2004;Build 12
  1. ;;Per VHA Directive 10-93-142, this routine should not be modified.
  1. ;
  1. D ^BPSJVAL1
  1. K DIR,X S DIR(0)="EO" D ^DIR
  1. I X=U Q
  1. D ^BPSJVAL2
  1. Q
  1. ;
  1. VAL1(VALCK) ; Application
  1. N RETCODE,VERBOSE,IX2
  1. ;
  1. ; VALCK=0 = validation, HL7 trigger, no display
  1. I '$G(VALCK) N RETCODE D Q RETCODE ; 0 means ok, '0 means invalid
  1. . ;-validate and quit if ok
  1. . S RETCODE=0 D VALIDATE^BPSJVAL1 I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. . I 'RETCODE Q
  1. . ;-invalid data, send an email
  1. . S MCT=1+$G(MCT),MSG(MCT)="ECME Application Registration HL7 Message not created."
  1. . F IX2=1:1:RETCODE I $G(RETCODE(IX2))]"" D
  1. .. S MCT=1+MCT,MSG(MCT)=$G(RETCODE(IX2))
  1. . D MSG^BPSJUTL(.MSG,"ECME Application Registration")
  1. ;
  1. ; VALCK=1 = validation, HL7 trigger, display
  1. I $G(VALCK)=1 N RETCODE D Q RETCODE ; 0 means ok, '0 means invalid
  1. . S RETCODE=0,VERBOSE=1 D VALIDATE^BPSJVAL1
  1. . I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. ;
  1. ; VALCK=2 = validation, no HL7 trigger, display
  1. I $G(VALCK)=2 N RETCODE D Q 1
  1. . S RETCODE=0,VERBOSE=1 D VALIDATE^BPSJVAL1
  1. . I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. ;
  1. ; VALCK=3 = validation, no HL7 trigger, no display
  1. I $G(VALCK)=3 N RETCODE D Q 1
  1. . S RETCODE=0 D VALIDATE^BPSJVAL1
  1. . I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. ;
  1. Q
  1. ;
  1. VAL2(VALCK,BPSJD) ; Pharmacies
  1. N RETCODE,VERBOSE,IX2
  1. ;
  1. ; VALCK=0 = validation, HL7 trigger, no display
  1. I '$G(VALCK) N RETCODE D Q RETCODE ; 0 means ok, '0 means invalid
  1. . ;-validate and quit if ok
  1. . S RETCODE=0 D VALIDATE^BPSJVAL2(BPSJD) I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. . I 'RETCODE Q
  1. . ;-invalid data, send an email
  1. . S MCT=1+$G(MCT),MSG(MCT)="ECME Pharmacy Registration HL7 Message not created."
  1. . F IX2=1:1:RETCODE I $G(RETCODE(IX2))]"" D
  1. .. S MCT=1+MCT,MSG(MCT)=$G(RETCODE(IX2))
  1. . D MSG^BPSJUTL(.MSG,"ECME Pharmacy Registration")
  1. ;
  1. ; VALCK=1 = validation, HL7 trigger, display
  1. I $G(VALCK)=1 N RETCODE D Q RETCODE ; 0 means ok, '0 means invalid
  1. . S RETCODE=0,VERBOSE=1 D VALIDATE^BPSJVAL2(BPSJD)
  1. . I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. ;
  1. ; VALCK=2 = validation, no HL7 trigger, display
  1. I $G(VALCK)=2 N RETCODE D Q 1
  1. . S RETCODE=0,VERBOSE=1 D VALIDATE^BPSJVAL2(BPSJD)
  1. . I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. ;
  1. ; VALCK=3 = validation, no display, no HL7 trigger
  1. I $G(VALCK)=3 N RETCODE D Q 1
  1. . S RETCODE=0 D VALIDATE^BPSJVAL2(BPSJD)
  1. . I $G(BPSJVALR)=-1 S BPSJVALR=RETCODE
  1. ;
  1. Q