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

GMRVXCH3.m

Go to the documentation of this file.
GMRVXCH3 ;HIRMFO/YH,RM-CONVERT GMRV VITAL CATEGORY FILE ;8/1/96
 ;;4.0;Vitals/Measurements;;Apr 25, 1997
CONV53 ;  Kill off all data in 120.53 file.
 ;  Loop through Category table and build the appropriate 120.53 entry,
 ;  updating the Name, Vital Type, Minimum Entries, Maximum Entries,
 ;  Required Entry, Edit Order, Print Order and Default Qualifier
 ;  fields.
 N GMRVCNV,GMRVTYP,GMRVTDA,GMRVGEN,GMRVCHAR,GMRVCNT,GMRVLST
 S GMRVLST=0,GMRVCNT=0
 S GMRVCAT=""
 F  S GMRVCAT=$O(^TMP($J,"GMRVCAT",GMRVCAT)) Q:GMRVCAT=""  D
 .  S X=GMRVCAT,DIC="^GMRD(120.53,",DIC(0)="L",DLAYGO=120.53
 .  K DO,DD,DINUM D FILE^DICN Q:+Y'>0
 .  S GMRVDA=+Y,^TMP($J,"GMRVCAT",GMRVCAT)=GMRVDA
 .  S GMRVTYP=0
 .  F  S GMRVTYP=$O(^TMP($J,"GMRVCAT",GMRVCAT,GMRVTYP)) Q:GMRVTYP'>0  D
 .  .  S X=GMRVTYP,DA(1)=GMRVDA,DIC="^GMRD(120.53,"_DA(1)_",1,"
 .  .  S DIC(0)="L",DLAYGO=120.53,DIC("P")="120.531P" K DO,DD,DINUM
 .  .  D FILE^DICN Q:+Y'>0
 .  .  S $P(^GMRD(120.53,DA(1),1,+Y,0),"^",2)=$G(^TMP($J,"GMRVCAT",GMRVCAT,GMRVTYP))
 .  .  Q
 .  Q
 Q
DEFAULT ;CONVERT DEFAULT TEXT TO POINTER TO ^GMRD(120.52)
 N GMRVDA
 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
 .  S GMRVDA(2)=$P($G(^GMRD(120.53,GMRVDA,1,GMRVDA(1),0)),"^",7) Q:GMRVDA(2)=""!($D(^GMRD(120.52,+GMRVDA(2),0)))
 .  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:"")
 .  Q
 Q
OLD ; THE QUALIFIER ALREADY EXISTS
 S GMRVCHA(1)=$O(^GMRD(120.52,"B",GMRVCHA,0)) Q:GMRVCHA(1)'>0
 Q:$D(^GMRD(120.52,GMRVCHA(1),1,"B",GMRVTYP(1)))
 I '$D(^GMRD(120.52,GMRVCHA(1),1,0)) S ^GMRD(120.52,GMRVCHA(1),1,0)="^120.521P^0^0"
 S GDA=+$P(^GMRD(120.52,GMRVCHA(1),1,0),"^",3)+1
 S ^GMRD(120.52,GMRVCHA(1),1,GDA,0)=GMRVTYP(1)_"^"_GMRVCAT(1)_"^"_$P(GMRVLINE,"^",2,3)
 S ^GMRD(120.52,GMRVCHA(1),1,"B",GMRVTYP(1),GDA)="",^GMRD(120.52,"C",GMRVTYP(1),GMRVCHA(1),GDA)=""
 S $P(^GMRD(120.52,GMRVCHA(1),1,0),"^",3)=GDA,$P(^(0),"^",4)=$P(^(0),"^",4)+1
 Q
NEW ;NEW QUALIFIER
 S GDA=+$P(^GMRD(120.52,0),"^",3)+1
 S ^GMRD(120.52,GDA,0)=GMRVCHA,^GMRD(120.52,GDA,1,0)="^120.521P^1^1"
 S ^GMRD(120.52,"B",GMRVCHA,GDA)=""
 S ^GMRD(120.52,GDA,1,1,0)=GMRVTYP(1)_"^"_GMRVCAT(1)_"^"_$P(GMRVLINE,"^",2,3)
 S ^GMRD(120.52,GDA,1,"B",GMRVTYP(1),1)=""
 S ^GMRD(120.52,"C",GMRVTYP(1),GDA,1)=""
 S $P(^GMRD(120.52,0),"^",3)=GDA,$P(^(0),"^",4)=$P(^(0),"^",4)+1
 Q