source: WorldVistAEHR/trunk/r/GEN_MED_OTHER-GMV/GMVFSYN.m@ 701

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

initial load of WorldVistAEHR

File size: 3.2 KB
Line 
1GMVFSYN ;HOIFO/RM,YH,FT-X REFERENCE FOR VITAL TYPE, CATEGORY AND SYNONYM ;3/8/05 13:38
2 ;;5.0;GEN. MED. REC. - VITALS;**8**;Oct 31, 2002
3 ;
4 ; This routine uses the following IAs:
5 ; <None>
6 ;
7BSYNO(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF ACHR XREF ON
8 ; SYNONYM (.02) FIELD OF GMRV VITAL QUALIFIER (120.52) FILE.
9 ; THIS PROCEDURE SETS/KILLS THE FOLLOWING MUMPS INDICES: "BB".
10 ; Input variables: GMRVSK=1 if called from SET, 2 if from KILL
11 ; DA=DA array passed by reference.
12 ; X=value being indexed.
13 ;
14 S GMRVDA=DA N DA,GMRVY
15 S DA(1)=GMRVDA,DA=0
16 F S DA=$O(^GMRD(120.52,DA(1),1,DA)) Q:DA'>0 D
17 . S GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
18 . D BB($P(GMRVY,"^"),$P(GMRVY,"^",2),X,.DA,GMRVSK)
19 . Q
20 K GMRVDA
21 Q
22BTYP(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF BTYP XREF ON VITAL
23 ; TYPE (.01) FIELD OF VITAL TYPE (120.521) SUB-FILE OF GMRV
24 ; GMRV VITAL QUALIFIER (120.52) FILE. THIS PROCEDURE SETS/KILLS THE
25 ; FOLLOWING MUMPS INDEX: "BB".
26 ; Input variables: GMRVSK=1 if called from SET, 2 if from KILL
27 ; DA=DA array passed by reference.
28 ; X=value being indexed.
29 ;
30 N GMRVX,GMRVY
31 S GMRVX=$P($G(^GMRD(120.52,DA(1),0)),"^"),GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
32 D BB(X,$P(GMRVY,"^",2),$P(GMRVX,"^",2),.DA,GMRVSK)
33 Q
34BCAT(GMRVSK,DA,X) ; CALLED FROM SET/KILL LOGIC OF BCAT XREF ON CATEGORY
35 ; (.02) FIELD OF VITAL TYPE (120.521) SUBFILE OF GMRV VITAL QUALIFIER
36 ; (120.52) FILE. THIS PROCEDURE SETS/KILLS THE FOLLOWING MUMPS
37 ; INDEX: "BB".
38 ; Input variables: GMRVSK=1 if called from SET, 2 if from KILL
39 ; DA=DA array passed by reference.
40 ; X=value being indexed.
41 ;
42 N GMRVX,GMRVY
43 S GMRVX=$G(^GMRD(120.52,DA(1),0)),GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
44 D BB($P(GMRVY,"^"),X,$P(GMRVX,"^",2),.DA,GMRVSK)
45 Q
46BB(TYPE,CAT,CHAR,DA,SK) ; This procedure updates the "BB" index for the 120.52
47 ; file. This index has the following format:
48 ; ^GMRD(120.52,"BB",TYPE,CAT,CHAR,DA(1),DA)=""
49 ; Input variables:
50 ; TYPE=Vital Type (.01) field 120.521 sub-file.
51 ; CAT=Category (.02) field of 120.521 sub-file.
52 ; CHAR=Name (.01) field of 120.52 file.
53 ; DA=Passed by reference will have entry in 120.52 sub-file, DA,
54 ; and entry in 120.52 file, DA(1).
55 ; SK=1 if set xref, 2 if kill xref.
56 ;
57 Q:$G(TYPE)=""!($G(CAT)="")!($G(CHAR)="")!($G(DA(1))="")!($G(DA)="")
58 I $G(SK)=1 S ^GMRD(120.52,"BB",TYPE,CAT,CHAR,DA(1),DA)=""
59 I $G(SK)=2 K ^GMRD(120.52,"BB",TYPE,CAT,CHAR,DA(1),DA)
60 Q
61SCREEN ;SCREEN FOR DUPLICATE ENTRY FOR A VITAL TYPE
62 ; Called from SYNONYM field (#.02) of the GMRV VITAL QUALIFIER file
63 ; (#120.52) - ^DD(120.52,.02,0)
64 Q ; SYNONYMs will be provided by the standardization process.
65 Q:X="" S GMRVDA=DA N DA,GTYP,GCAT,GSYN
66 S DA(1)=GMRVDA,DA=0
67 F S DA=$O(^GMRD(120.52,DA(1),1,DA)) Q:DA'>0!'$D(X) D
68 . S GMRVY=$G(^GMRD(120.52,DA(1),1,DA,0))
69 . S GTYP=+$P(GMRVY,"^")
70 . I $D(^GMRD(120.52,"BB",GTYP)) D
71 . .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&'$D(^(GSYN,DA(1))) W:'$D(ZTQUEUED) !!,X K X
72 K GMRVDA Q
Note: See TracBrowser for help on using the repository browser.