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

VAQFILE2.m

Go to the documentation of this file.
  1. VAQFILE2 ;ALB/MFK - MESSAGE FILING;19-OCT-95
  1. ;;1.5;PATIENT DATA EXCHANGE;**16,20**;NOV 17, 1993
  1. FILESEG(FILE,DA,FIELD,VALUE1,VALUE2,VALUE3) ;FILE INFORMATION
  1. ;INPUT : FILE - File number
  1. ; DA - IFN of entry to edit
  1. ; FIELD - Field of multiple
  1. ; VALUE1 - Name of segment to be filed
  1. ; VALUE2 - Time limit of segment being filed
  1. ; VALUE3 - Occurrence limit of segment being filed
  1. ;OUTPUT : 0 - Success
  1. ; -1^Error_text - Error
  1. ;NOTES : It is the responsibility of
  1. ; the calling routine to verify that VALUE can be added as
  1. ; an entry in the multiple. It is also the responsibility
  1. ; of the calling routine to verify that VALUE is an entry in
  1. ; the subfile when deleting/editing.
  1. ;
  1. ;CHECK INPUT
  1. Q:('$G(FILE)) "-1^Did not pass file number"
  1. Q:('$D(^DD(FILE))) "-1^Did not pass valid file number"
  1. Q:('$G(DA)) "-1^Did not pass entry number"
  1. Q:('$D(FIELD)) "-1^Field not passed"
  1. S VALUE1=$G(VALUE1)
  1. Q:(VALUE1="") "-1^No .01 sent"
  1. S VALUE2=$G(VALUE2)
  1. S VALUE3=$G(VALUE3)
  1. ;DECLARE VARIABLES
  1. N DIE,DR,X,DIC,Y,DLAYGO
  1. K DD,DO
  1. ; SET UP FILE^DICN CALL
  1. S DIC=$G(^DIC(FILE,0,"GL"))
  1. S DIC(0)="XL"
  1. S DLAYGO=FILE
  1. Q:(DIC="") "-1^Could not determine global root of file"
  1. Q:('$D(@(DIC_DA_")"))) "-1^Did not pass valid entry number"
  1. S MULT=$P($P($G(^DD(FILE,FIELD,0)),"^",4),";",1)
  1. S DIC=DIC_DA_",MULT,"
  1. S DIC("P")=+$P($G(^DD(FILE,FIELD,0)),"^",2)
  1. I ('DIC("P")) Q "-1^Main field is not a multiple"
  1. S DA(1)=DA
  1. S DIC("DR")=".01////"_VALUE1_";.02////"_VALUE2_";.03////"_VALUE3
  1. S X=VALUE1
  1. D FILE^DICN
  1. Q:($D(Y)="-1") "-1^Could not file new value"
  1. Q 0