source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVFUT2.m@ 1358

Last change on this file since 1358 was 613, checked in by George Lilly, 15 years ago

initial load of WorldVistAEHR

File size: 2.9 KB
Line 
1GMRVFUT2 ;HIRMFO/RM-FILE UTILITIES FOR 120.52 FILE ;5/1/97
2 ;;4.0;Vitals/Measurements;**1**;Apr 25, 1997
3 ;
4ACHR(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF ACHR XREF ON
5 ; QUALIFIER (.01) FIELD OF GMRV VITAL QUALIFIER (120.52) FILE.
6 ; THIS PROCEDURE SETS/KILLS THE FOLLOWING MUMPS INDICES: "AA".
7 ; Input variables: GMRVSK=1 if called from SET, 2 if from KILL
8 ; DA=DA array passed by reference.
9 ; X=value being indexed.
10 ;
11 S GMRVDA=DA N DA,GMRVY
12 S DA(1)=GMRVDA,DA=0
13 F S DA=$O(^GMRD(120.52,DA(1),1,DA)) Q:DA'>0 D
14 . S GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
15 . D AA($P(GMRVY,"^"),$P(GMRVY,"^",2),X,.DA,GMRVSK)
16 . Q
17 K GMRVDA
18 Q
19ATYP(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF ATYP XREF ON VITAL
20 ; TYPE (.01) FIELD OF VITAL TYPE (120.521) SUB-FILE OF GMRV
21 ; GMRV VITAL QUALIFIER (120.52) FILE. THIS PROCEDURE SETS/KILLS THE
22 ; FOLLOWING MUMPS INDEX: "AA".
23 ; Input variables: GMRVSK=1 if called from SET, 2 if from KILL
24 ; DA=DA array passed by reference.
25 ; X=value being indexed.
26 ;
27 N GMRVX,GMRVY
28 S GMRVX=$P($G(^GMRD(120.52,DA(1),0)),"^"),GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
29 D AA(X,$P(GMRVY,"^",2),$P(GMRVX,"^"),.DA,GMRVSK)
30 Q
31ACAT(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF ACAT XREF ON CATEGORY
32 ; (.02) FIELD OF VITAL TYPE (120.521) SUBFILE OF GMRV VITAL QUALIFIER
33 ; (120.52) FILE. THIS PROCEDURE SETS/KILLS THE FOLLOWING MUMPS
34 ; INDEX: "AA".
35 ; Input variables: GMRVSK=1 if called from SET, 2 if from KILL
36 ; DA=DA array passed by reference.
37 ; X=value being indexed.
38 ;
39 N GMRVX,GMRVY
40 S GMRVX=$G(^GMRD(120.52,DA(1),0)),GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
41 D AA($P(GMRVY,"^"),X,$P(GMRVX,"^"),.DA,GMRVSK)
42 Q
43AA(TYPE,CAT,CHAR,DA,SK) ; This procedure updates the "AA" index for the 120.52
44 ; file. This index has the following format:
45 ; ^GMRD(120.52,"AA",TYPE,CAT,CHAR,DA(1),DA)=""
46 ; Input variables:
47 ; TYPE=Vital Type (.01) field 120.521 sub-file.
48 ; CAT=Category (.02) field of 120.521 sub-file.
49 ; CHAR=Name (.01) field of 120.52 file.
50 ; DA=Passed by reference will have entry in 120.52 sub-file, DA,
51 ; and entry in 120.52 file, DA(1).
52 ; SK=1 if set xref, 2 if kill xref.
53 ;
54 Q:$G(TYPE)=""!($G(CAT)="")!($G(CHAR)="")!($G(DA(1))="")!($G(DA)="")
55 I $G(SK)=1 S ^GMRD(120.52,"AA",TYPE,CAT,CHAR,DA(1),DA)=""
56 I $G(SK)=2 K ^GMRD(120.52,"AA",TYPE,CAT,CHAR,DA(1),DA)
57 Q
58SCR02(Y,DA) ; CALLED FROM INPUT TRANSFORM OF CATEGORY (.02) FIELD OF THE
59 ; VITAL TYPE (120.521) SUB-FILE OF THE GMRV VITAL QUALIFIER
60 ; (120.52) FILE. WILL CHECK TO SEE IF CATEGORY IS VALID FOR THIS
61 ; VITAL TYPE.
62 ; Input Variables: DA = DA arrary passed by reference from screen.
63 ; Y = Entry in 120.53 file being validated.
64 ;
65 N GMRVFXN,GMRVTYP S GMRVFXN=0
66 S GMRVTYP=$P($G(^GMRD(120.52,DA(1),1,DA,0)),"^")
67 I GMRVTYP>0,$D(^GMRD(120.53,"C",GMRVTYP,+Y)) S GMRVFXN=1
68 Q GMRVFXN
Note: See TracBrowser for help on using the repository browser.