source: WorldVistAEHR/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVFSYN.m@ 1211

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

initial load of WorldVistAEHR

File size: 3.0 KB
Line 
1GMRVFSYN ;HIRMFO/RM,YH-X REFERENCE FOR VITAL TYPE, CATEGORY AND SYNONYM ;5/22/97
2 ;;4.0;Vitals/Measurements;**1**;Apr 25, 1997
3 ;
4BSYNO(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF ACHR XREF ON
5 ; SYNONYM (.02) FIELD OF GMRV VITAL QUALIFIER (120.52) FILE.
6 ; THIS PROCEDURE SETS/KILLS THE FOLLOWING MUMPS INDICES: "BB".
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 BB($P(GMRVY,"^"),$P(GMRVY,"^",2),X,.DA,GMRVSK)
16 . Q
17 K GMRVDA
18 Q
19BTYP(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF BTYP 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: "BB".
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 BB(X,$P(GMRVY,"^",2),$P(GMRVX,"^",2),.DA,GMRVSK)
30 Q
31BCAT(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF BCAT 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: "BB".
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 BB($P(GMRVY,"^"),X,$P(GMRVX,"^",2),.DA,GMRVSK)
42 Q
43BB(TYPE,CAT,CHAR,DA,SK) ; This procedure updates the "BB" index for the 120.52
44 ; file. This index has the following format:
45 ; ^GMRD(120.52,"BB",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,"BB",TYPE,CAT,CHAR,DA(1),DA)=""
56 I $G(SK)=2 K ^GMRD(120.52,"BB",TYPE,CAT,CHAR,DA(1),DA)
57 Q
58SCREEN ;SCREEN FOR DUPLICATE ENTRY FOR A VITAL TYPE
59 Q:X="" S GMRVDA=DA N DA,GTYP,GCAT,GSYN
60 S DA(1)=GMRVDA,DA=0
61 F S DA=$O(^GMRD(120.52,DA(1),1,DA)) Q:DA'>0!'$D(X) D
62 . S GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
63 . S GTYP=+$P(GMRVY,"^")
64 . I $D(^GMRD(120.52,"BB",GTYP)) D
65 . . S GCAT=0 F S GCAT=$O(^GMRD(120.52,"BB",GTYP,GCAT)) Q:GCAT'>0!'$D(X) S GSYN="" F S GSYN=$O(^GMRD(120.52,"BB",GTYP,GCAT,GSYN)) Q:GSYN=""!'$D(X) I GSYN=X W:'$D(ZTQUEUED) !!,X," has been entered for "_$P(^GMRD(120.51,GTYP,0),"^"),!! K X
66 K GMRVDA Q
Note: See TracBrowser for help on using the repository browser.