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

BCHFORM.m

Go to the documentation of this file.
  1. BCHFORM ; IHS/CMI/LAB - ASSIGN UNIQUE FORM # ;
  1. ;;2.0;IHS RPMS CHR SYSTEM;;OCT 23, 2012;Build 27
  1. ;
  1. ;Called from a cross reference in CHR Record.
  1. ;Generates next form # for a chr on a particular date.
  1. ;
  1. EN ;EP - called from xbnew
  1. S DIE="^BCHR(",DA=%,DR=".25///"_%1 D ^DIE
  1. Q
  1. SET1 ;EP - called form data dictionary cross reference
  1. Q:$P(^BCHR(DA,0),U,3)=""
  1. Q:$P(^BCHR(DA,0),U,2)=""
  1. NEW %1 S (%,%1)="" F S %=$O(^BCHR("AF",$P(^BCHR(DA,0),U,3),$P(^(0),U,2),$P(X,"."),%)) Q:%'=+% S %1=%
  1. ;call xbnew
  1. S %1=%1+1,%=DA
  1. D ^XBNEW("EN^BCHFORM:%;%1")
  1. Q
  1. KILL1 ;EP
  1. Q:$P(^BCHR(DA,0),U,3)=""
  1. Q:$P(^BCHR(DA,0),U,2)=""
  1. Q:$P(^BCHR(DA,0),U,25)=""
  1. K ^BCHR("AF",$P(^BCHR(DA,0),U,3),$P(^(0),U,2),$P(X,"."),$P(^(0),U,25),DA)
  1. Q
  1. SET2 ;EP - called form data dictionary cross reference
  1. Q:$P(^BCHR(DA,0),U,3)=""
  1. Q:$P(^BCHR(DA,0),U)=""
  1. NEW %1 S (%,%1)="" F S %=$O(^BCHR("AF",$P(^BCHR(DA,0),U,3),X,$P($P(^(0),U),"."),%)) Q:%'=+% S %1=%
  1. ;call xbnew
  1. S %1=%1+1,%=DA
  1. D ^XBNEW("EN^BCHFORM:%;%1")
  1. Q
  1. KILL2 ;EP
  1. Q:$P(^BCHR(DA,0),U,3)=""
  1. Q:$P(^BCHR(DA,0),U)=""
  1. Q:$P(^BCHR(DA,0),U,25)=""
  1. K ^BCHR("AF",$P(^BCHR(DA,0),U,3),X,$P($P(^(0),U),"."),$P(^(0),U,25),DA)
  1. Q
  1. SET3 ;EP - called form data dictionary cross reference
  1. Q:$P(^BCHR(DA,0),U)=""
  1. Q:$P(^BCHR(DA,0),U,2)=""
  1. NEW %1 S (%,%1)="" F S %=$O(^BCHR("AF",X,$P(^BCHR(DA,0),U,2),$P($P(^(0),U),"."),%)) Q:%'=+% S %1=%
  1. ;call xbnew
  1. S %1=%1+1,%=DA
  1. D ^XBNEW("EN^BCHFORM:%;%1")
  1. Q
  1. KILL3 ;EP
  1. Q:$P(^BCHR(DA,0),U)=""
  1. Q:$P(^BCHR(DA,0),U,2)=""
  1. Q:$P(^BCHR(DA,0),U,25)=""
  1. K ^BCHR("AF",X,$P(^BCHR(DA,0),U,2),$P($P(^(0),U),"."),$P(^(0),U,25),DA)
  1. Q