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

DGPFANF.m

Go to the documentation of this file.
  1. DGPFANF ;ALB/KCL - PRF NATIONAL FLAG API'S ; 4/7/04 2:09pm
  1. ;;5.3;Registration;**425,554,1015**;Aug 13, 1993;Build 21
  1. ;
  1. ;- no direct entry
  1. QUIT
  1. ;
  1. GETNF(DGPFIEN,DGPFNF) ;retrieve a single NATIONAL FLAG record
  1. ;This function returns a single flag record from the PRF NATIONAL FLAG
  1. ;file and returns it in an array format.
  1. ;
  1. ; Input:
  1. ; DGPFIEN - (required) pointer to national flag record in the
  1. ; PRF NATIONAL FLAG (#26.15) file
  1. ; DGPFNF - (required) result array passed by reference
  1. ;
  1. ; Output:
  1. ; Function Value - returns 1 on success, 0 on failure
  1. ; DGPFNF - output array containing national flag record field
  1. ; values.
  1. ; Subscript Field# Data
  1. ; -------------- ------- ---------------------
  1. ; "FLAG" .01 internal^external
  1. ; "STAT" .02 internal^external
  1. ; "TYPE" .03 internal^external
  1. ; "REVFREQ" .04 internal^external
  1. ; "NOTIDAYS" .05 internal^external
  1. ; "REVGRP" .06 internal^external
  1. ; "TIUTITLE" .07 internal^external
  1. ; "DESC",line#,0 1 character string
  1. ; "PRININV",line#,0 2 character string
  1. ;
  1. N DGIENS ;IEN string for DIQ
  1. N DGFLDS ;results array for DIQ
  1. N DGERR ;error arrary for DIQ
  1. N DGSUB ;pincipal investigator multiple subscript
  1. N RESULT ;return function value
  1. ;
  1. S RESULT=0
  1. ;
  1. I $G(DGPFIEN)>0,$D(^DGPF(26.15,DGPFIEN)) D
  1. . S DGIENS=DGPFIEN_","
  1. . D GETS^DIQ(26.15,DGIENS,"**","IEZ","DGFLDS","DGERR")
  1. . Q:$D(DGERR)
  1. . ;
  1. . ;-- build national flag array
  1. . S DGPFNF("FLAG")=$G(DGFLDS(26.15,DGIENS,.01,"I"))_U_$G(DGFLDS(26.15,DGIENS,.01,"E"))
  1. . S DGPFNF("STAT")=$G(DGFLDS(26.15,DGIENS,.02,"I"))_U_$G(DGFLDS(26.15,DGIENS,.02,"E"))
  1. . S DGPFNF("TYPE")=$G(DGFLDS(26.15,DGIENS,.03,"I"))_U_$G(DGFLDS(26.15,DGIENS,.03,"E"))
  1. . S DGPFNF("REVFREQ")=$G(DGFLDS(26.15,DGIENS,.04,"I"))_U_$G(DGFLDS(26.15,DGIENS,.04,"E"))
  1. . S DGPFNF("NOTIDAYS")=$G(DGFLDS(26.15,DGIENS,.05,"I"))_U_$G(DGFLDS(26.15,DGIENS,.05,"E"))
  1. . S DGPFNF("REVGRP")=$G(DGFLDS(26.15,DGIENS,.06,"I"))_U_$G(DGFLDS(26.15,DGIENS,.06,"E"))
  1. . S DGPFNF("TIUTITLE")=$G(DGFLDS(26.15,DGIENS,.07,"I"))_U_$G(DGFLDS(26.15,DGIENS,.07,"E"))
  1. . ;-- flag description word processing array
  1. . M DGPFNF("DESC")=DGFLDS(26.15,DGIENS,1)
  1. . K DGPFNF("DESC","E"),DGPFNF("DESC","I")
  1. . ;-- principal investigator(s) multiple
  1. . S DGSUB="" F S DGSUB=$O(DGFLDS(26.152,DGSUB)) Q:DGSUB="" D
  1. . . S DGPFNF("PRININV",+DGSUB,0)=$G(DGFLDS(26.152,DGSUB,.01,"I"))_U_$G(DGFLDS(26.152,DGSUB,.01,"E"))
  1. . ;
  1. . S RESULT=1
  1. ;
  1. Q RESULT