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

AZHRDEM1.m

Go to the documentation of this file.
AZHRDEM1 ; [ 04/19/90  10:50 AM ]
 D ^%AUKVAR S (AZHRMALS,AZHRFEMS,AZHRSTS,AZHRADDS)=0
 W !,"BUILDING RANDOM NAME TABLES...",!
 S AZHRMAX=$P(^DPT(0),U,3)*.1,AZHRDFN=0 
 F  S AZHRDFN=$O(^DPT(AZHRDFN)) Q:AZHRDFN'=+AZHRDFN!((AZHRMALS+AZHRFEMS)>(AZHRMAX-1))  D BILDNAM D:$D(^DPT(AZHRDFN,.11)) BILDADD
 S ^AZHRRAND("M",0)=AZHRMALS,^AZHRRAND("F",0)=AZHRFEMS,^AZHRRAND("A",0)=AZHRADDS K ^AZHRRAND("T")
 D BILDST
 K AZHRMALS,AZHRFEMS,AZHRMAX,AZHRDFN,AZHRSEX,AZHRNAME,AZHRRAND,AZHRSTS,AZHRCOM,AZHRST,AZHRADDR,AZHRADDS
 Q
BILDNAM ;
 S AZHRNAME=$P($P(^DPT(AZHRDFN,0),U,1),",",2)
 S AZHRSEX=$P(^DPT(AZHRDFN,0),U,2)
 D:AZHRSEX="M"&(AZHRMALS<(AZHRMAX/2)) MALNAM
 D:AZHRSEX="F"&(AZHRFEMS<(AZHRMAX/2)) FEMNAM
 Q
MALNAM ;
 I '$D(^AZHRRAND("T",AZHRNAME)) S AZHRMALS=AZHRMALS+1,^AZHRRAND("T",AZHRNAME)="",^AZHRRAND("M",AZHRMALS)=AZHRNAME W "M"
 Q
FEMNAM ;
 I '$D(^AZHRRAND("T",AZHRNAME)) S AZHRFEMS=AZHRFEMS+1,^AZHRRAND("T",AZHRNAME)="",^AZHRRAND("F",AZHRFEMS)=AZHRNAME W "F"
 Q
BILDADD ;
 S AZHRADDR=$P(^DPT(AZHRDFN,.11),U,1)
 I AZHRADDR'="",'$D(^AZHRRAND("T",AZHRADDR)) S AZHRADDS=AZHRADDS+1,^AZHRRAND("T",AZHRADDR)="",^AZHRRAND("A",AZHRADDS)=AZHRADDR W "A"
 Q
BILDST ;
 S AZHRST=$P(^AUTTLOC(DUZ(2),0),U,14),AZHRCOM=0
 F  S AZHRCOM=$O(^AUTTCOM(AZHRCOM)) Q:AZHRCOM'=+AZHRCOM  I $P(^AUTTCOM(AZHRCOM,0),U,3)=AZHRST S AZHRSTS=AZHRSTS+1,^AZHRRAND("S",AZHRSTS)=$P(^AUTTCOM(AZHRCOM,0),U,1) W "S"
 S ^AZHRRAND("S",0)=AZHRSTS
 Q