source: FOIAVistA/trunk/r/GEN_MED_REC_VITALS-GMRV/GMRVXCH3.m@ 1751

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

initial load of FOIAVistA 6/30/08 version

File size: 2.4 KB
Line 
1GMRVXCH3 ;HIRMFO/YH,RM-CONVERT GMRV VITAL CATEGORY FILE ;8/1/96
2 ;;4.0;Vitals/Measurements;;Apr 25, 1997
3CONV53 ; Kill off all data in 120.53 file.
4 ; Loop through Category table and build the appropriate 120.53 entry,
5 ; updating the Name, Vital Type, Minimum Entries, Maximum Entries,
6 ; Required Entry, Edit Order, Print Order and Default Qualifier
7 ; fields.
8 N GMRVCNV,GMRVTYP,GMRVTDA,GMRVGEN,GMRVCHAR,GMRVCNT,GMRVLST
9 S GMRVLST=0,GMRVCNT=0
10 S GMRVCAT=""
11 F S GMRVCAT=$O(^TMP($J,"GMRVCAT",GMRVCAT)) Q:GMRVCAT="" D
12 . S X=GMRVCAT,DIC="^GMRD(120.53,",DIC(0)="L",DLAYGO=120.53
13 . K DO,DD,DINUM D FILE^DICN Q:+Y'>0
14 . S GMRVDA=+Y,^TMP($J,"GMRVCAT",GMRVCAT)=GMRVDA
15 . S GMRVTYP=0
16 . F S GMRVTYP=$O(^TMP($J,"GMRVCAT",GMRVCAT,GMRVTYP)) Q:GMRVTYP'>0 D
17 . . S X=GMRVTYP,DA(1)=GMRVDA,DIC="^GMRD(120.53,"_DA(1)_",1,"
18 . . S DIC(0)="L",DLAYGO=120.53,DIC("P")="120.531P" K DO,DD,DINUM
19 . . D FILE^DICN Q:+Y'>0
20 . . S $P(^GMRD(120.53,DA(1),1,+Y,0),"^",2)=$G(^TMP($J,"GMRVCAT",GMRVCAT,GMRVTYP))
21 . . Q
22 . Q
23 Q
24DEFAULT ;CONVERT DEFAULT TEXT TO POINTER TO ^GMRD(120.52)
25 N GMRVDA
26 S GMRVDA=0 F S GMRVDA=$O(^GMRD(120.53,GMRVDA)) Q:GMRVDA'>0 S GMRVDA(1)=0 F S GMRVDA(1)=$O(^GMRD(120.53,GMRVDA,1,GMRVDA(1))) Q:GMRVDA(1)'>0 D
27 . S GMRVDA(2)=$P($G(^GMRD(120.53,GMRVDA,1,GMRVDA(1),0)),"^",7) Q:GMRVDA(2)=""!($D(^GMRD(120.52,+GMRVDA(2),0)))
28 . S $P(^GMRD(120.53,GMRVDA,1,GMRVDA(1),0),"^",7)=$S($D(^GMRD(120.52,"B",GMRVDA(2))):$O(^GMRD(120.52,"B",GMRVDA(2),0)),1:"")
29 . Q
30 Q
31OLD ; THE QUALIFIER ALREADY EXISTS
32 S GMRVCHA(1)=$O(^GMRD(120.52,"B",GMRVCHA,0)) Q:GMRVCHA(1)'>0
33 Q:$D(^GMRD(120.52,GMRVCHA(1),1,"B",GMRVTYP(1)))
34 I '$D(^GMRD(120.52,GMRVCHA(1),1,0)) S ^GMRD(120.52,GMRVCHA(1),1,0)="^120.521P^0^0"
35 S GDA=+$P(^GMRD(120.52,GMRVCHA(1),1,0),"^",3)+1
36 S ^GMRD(120.52,GMRVCHA(1),1,GDA,0)=GMRVTYP(1)_"^"_GMRVCAT(1)_"^"_$P(GMRVLINE,"^",2,3)
37 S ^GMRD(120.52,GMRVCHA(1),1,"B",GMRVTYP(1),GDA)="",^GMRD(120.52,"C",GMRVTYP(1),GMRVCHA(1),GDA)=""
38 S $P(^GMRD(120.52,GMRVCHA(1),1,0),"^",3)=GDA,$P(^(0),"^",4)=$P(^(0),"^",4)+1
39 Q
40NEW ;NEW QUALIFIER
41 S GDA=+$P(^GMRD(120.52,0),"^",3)+1
42 S ^GMRD(120.52,GDA,0)=GMRVCHA,^GMRD(120.52,GDA,1,0)="^120.521P^1^1"
43 S ^GMRD(120.52,"B",GMRVCHA,GDA)=""
44 S ^GMRD(120.52,GDA,1,1,0)=GMRVTYP(1)_"^"_GMRVCAT(1)_"^"_$P(GMRVLINE,"^",2,3)
45 S ^GMRD(120.52,GDA,1,"B",GMRVTYP(1),1)=""
46 S ^GMRD(120.52,"C",GMRVTYP(1),GDA,1)=""
47 S $P(^GMRD(120.52,0),"^",3)=GDA,$P(^(0),"^",4)=$P(^(0),"^",4)+1
48 Q
Note: See TracBrowser for help on using the repository browser.