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

PRCPCSO1.m

Go to the documentation of this file.
  1. PRCPCSO1 ;WISC/RFJ-surgery order supplies ; 06/23/2009 2:26 PM
  1. ;;5.1;IFCAP;**136**;Oct 20, 2000;Build 6
  1. ;Per VHA Directive 2004-038, this routine should not be modified.
  1. Q
  1. ;
  1. ;
  1. AUTOORD ; automatically create order
  1. N ORDERNO
  1. D SHOWCC^PRCPCSOU(OPCODE,0,$G(OPDATEI))
  1. S XP="Do you want to automatically create and add items to a new order"
  1. S XH="Enter 'YES' to automatically create an order with the items on it,",XH(1)="enter 'NO' to select the order and items, or",XH(2)="enter '^' to select a new patient and operation."
  1. W ! S %=$$YN^PRCPUYN(1)
  1. I %=2 Q
  1. I %'=1 S PRCPFLAG=1 Q
  1. W !!,"CREATING ORDER:"
  1. D NEWORDER^PRCPOPUS(PRCPPRIM) I '$G(X) S ORDERDA=0 Q
  1. S ORDERNO=X
  1. S ORDERDA=+$$ADDNEW^PRCPOPUS(ORDERNO,PRCPPRIM,PRCPSECO) I 'ORDERDA Q
  1. L +^PRCP(445.3,ORDERDA):5 I '$T D SHOWWHO^PRCPULOC(445.3,ORDERDA,0) S ORDERDA=0 Q
  1. D ADD^PRCPULOC(445.3,ORDERDA,0,"Ordering Surgical Supplies")
  1. ; tie patient and operation to the order
  1. D PATLINK^PRCPCSOR(ORDERDA,PRCPPAT,PRCPSURG)
  1. W " NUMBER ",ORDERNO
  1. Q