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

GMVGETC.m

Go to the documentation of this file.
  1. GMVGETC ;HOIFO/FT-GET CATEGORY INFORMATION ;2/26/07 15:32
  1. ;;5.0;GEN. MED. REC. - VITALS;**23**;Oct 31, 2002;Build 25
  1. ;
  1. ; This routine uses the following IAs:
  1. ; <None>
  1. ;
  1. ; This routine supports the following IAs:
  1. ; #5050 - FIELD, GETIEN, VT entry points (supported)
  1. ;
  1. FIELD(GMVIEN,GMVFIELD,GMVFMT) ; Returns the FILE 120.53 value
  1. ; Input: GMVIEN = File 120.53 internal entry number (required)
  1. ; GMVFIELD = field you want (required)
  1. ; 1 = Name (.01)
  1. ; 2 = VUID (99.99)
  1. ; 3 = Master Entry For VUID (99.98)
  1. ; GMVFMT = return internal or external value (optional)
  1. ; I for Internal, E for External
  1. ; default is E
  1. ; Output: field value or -1 if there is an error
  1. ;
  1. I $G(GMVIEN)="" Q -1
  1. I $G(GMVFIELD)="" Q -1
  1. S GMVFMT=$G(GMVFMT)
  1. S GMVFMT=$$UPPER^GMVGETVT(GMVFMT)
  1. S GMVFMT=$S(GMVFMT="I":"I",1:"E")
  1. I GMVFIELD=1 Q $$GET1^DIQ(120.53,+GMVIEN,.01,GMVFMT)
  1. I GMVFIELD=2 Q $$GET1^DIQ(120.53,+GMVIEN,99.99,GMVFMT)
  1. I GMVFIELD=3 Q $$GET1^DIQ(120.53,+GMVIEN,99.98,GMVFMT)
  1. Q -1
  1. ;
  1. GETIEN(GMVX,GMVY) ; Returns the qualifier IEN
  1. ; Input: GMVX - File 120.53 look up value (required)
  1. ; GMVY - index type (required)
  1. ; 1 - Name (.01)
  1. ; 2 - VUID (99.99)
  1. ; Output: File 120.53 internal entry number,
  1. ; or null if not found,
  1. ; or -1 if there is an error
  1. N GMVIEN
  1. I $G(GMVX)="" Q -1
  1. I $G(GMVY)="" Q -1
  1. I GMVY=1 Q $O(^GMRD(120.53,"B",GMVX,0))
  1. I GMVY=2 Q $O(^GMRD(120.53,"AVUID",GMVX,0))
  1. Q -1
  1. ;
  1. VT(RESULT,GMVIEN) ; Returns the vital types (field #1) values
  1. ; Input: RESULT = Array name to return data in (required)
  1. ; GMVIEN = File 120.53 internal entry number (required)
  1. ; Output: RESULT(0)=piece1
  1. ; RESULT(n)=piece2^piece3
  1. ;
  1. ; where piece1 = number of entries found or -1 if an error
  1. ; piece2 = FILE 120.51 entry number
  1. ; piece3 = FILE 120.51, Field .01 external value
  1. ; n = a sequential number starting with 1
  1. ;
  1. N GMVCNT,GMVLOOP,GMVNODE,GMVVTE,GMVVTI
  1. ; What if RESULT is not defined?
  1. S (GMVCNT,GMVLOOP,RESULT(0))=0
  1. I $G(GMVIEN)="" Q
  1. F S GMVLOOP=$O(^GMRD(120.53,GMVIEN,1,GMVLOOP)) Q:'GMVLOOP D
  1. .S GMVNODE=$G(^GMRD(120.53,GMVIEN,1,GMVLOOP,0))
  1. .Q:GMVNODE=""
  1. .S GMVVTI=$P(GMVNODE,U,1)
  1. .Q:'GMVVTI
  1. .S GMVVTE=$$FIELD^GMVGETVT(GMVVTI,1,"E")
  1. .Q:GMVVTE=-1
  1. .S GMVCNT=GMVCNT+1
  1. .S RESULT(GMVCNT)=GMVVTI_U_GMVVTE
  1. .Q
  1. S RESULT(0)=GMVCNT
  1. Q
  1. ;