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

GMVGETQL.m

Go to the documentation of this file.
  1. GMVGETQL ;HOIFO/FT-GET QUALIFIER INFORMATION ;2/26/07 16:27
  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. ; #5048 - FIELD, GETIEN, VT entry points (supported)
  1. ;
  1. FIELD(GMVIEN,GMVFIELD,GMVFMT) ; Returns the qualifier values
  1. ; Input: GMVIEN - File 120.52 internal entry number (required)
  1. ; GMVFIELD - field you want (required)
  1. ; 1 = name(.01)
  1. ; 2 = Synonym (.02)
  1. ; 3 = VUID (99.99)
  1. ; 4 = Master Entry For VUID
  1. ; GMVFMT - return internal or external value (optional)
  1. ; I fo 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=$E($G(GMVFMT,"E"))
  1. S GMVFMT=$$UPPER^GMVGETVT(GMVFMT)
  1. S GMVFMT=$S(GMVFMT="I":"I",1:"E")
  1. I GMVFIELD=1 Q $$GET1^DIQ(120.52,+GMVIEN,.01,GMVFMT)
  1. I GMVFIELD=2 Q $$GET1^DIQ(120.52,+GMVIEN,.02,GMVFMT)
  1. I GMVFIELD=3 Q $$GET1^DIQ(120.52,+GMVIEN,99.99,GMVFMT)
  1. I GMVFIELD=4 Q $$GET1^DIQ(120.52,+GMVIEN,99.96,GMVFMT)
  1. Q -1
  1. ;
  1. GETIEN(GMVX,GMVY) ; Returns the qualifier IEN
  1. ; Input: GMVX - File 120.52 look up value (required)
  1. ; GMVY - index type (required)
  1. ; 1 = name (.01)
  1. ; 2 = VUID (99.99)
  1. ; Output: File 120.52 internal entry number
  1. ; or null if not found
  1. ; or -1 if there is an error
  1. ;
  1. I $G(GMVX)="" Q -1
  1. I $G(GMVY)="" Q -1
  1. I GMVY=1 Q $O(^GMRD(120.52,"B",GMVX,0))
  1. I GMVY=2 Q $O(^GMRD(120.52,"AVUID",GMVX,0))
  1. Q -1
  1. ;
  1. VT(RESULT,GMVIEN) ; Returns the vital types and category values for a qualifier
  1. ; Input: RESULT = Array name to return data in (required)
  1. ; GMVIEN = File 120.52 internal entry number (required)
  1. ; Output: RESULT(0)=piece1
  1. ; RESULT(n)=piece2^piece3^piece4^piece5
  1. ; where piece1 = number of entries found or -1 if an error
  1. ; piece2 = File 120.51 entry number
  1. ; piece3 = File 120.51 .01 field value
  1. ; piece4 = File 120.53 entry number
  1. ; piece5 = File 120.53 .01 field value
  1. ; n = sequential number starting with 1
  1. ;
  1. N GMVCATE,GMVCATI,GMVCNT,GMVLOOP,GMVNODE,GMVTE,GMVTI
  1. S (GMVCNT,GMVLOOP)=0
  1. I $G(GMVIEN)="" Q
  1. ; check if RESULT is defined?
  1. F S GMVLOOP=$O(^GMRD(120.52,GMVIEN,1,GMVLOOP)) Q:'GMVLOOP D
  1. .S GMVNODE=$G(^GMRD(120.52,GMVIEN,1,GMVLOOP,0))
  1. .Q:GMVNODE=""
  1. .S GMVTI=$P(GMVNODE,U,1)
  1. .Q:'GMVTI
  1. .S GMVTE=$$FIELD^GMVGETVT(GMVTI,1,"E")
  1. .Q:GMVTE=""
  1. .S GMVCATI=$P(GMVNODE,U,2)
  1. .S GMVCATE=""
  1. .I GMVCATI S GMVCATE=$$FIELD^GMVGETC(GMVCATI,1,"E")
  1. .S GMVCNT=GMVCNT+1
  1. .S RESULT(GMVCNT)=GMVTI_U_GMVTE_U_GMVCATI_U_GMVCATE
  1. .Q
  1. S RESULT(0)=GMVCNT
  1. Q
  1. ;