#
# KEHOME/src/birth.icn
# Oct/5/2003 Mar/19/2007
## automatic: 8 proposition/infon
## meaning: 2 proposition/infon
#
#r_birth is relation with
# label=[pid, sex, birthname, birthdate, birthplace, deathdate, deathplace, deathcause],
# format=[person:1, sex:2, birthname:3, time:4, space:5, time:6, space:7, cause:8],
# automatic=ISA,
# meaning=procedure_birth;
## meaning={
## $1 isu person with pid=$1;
## $1 has sex=$2,birthname=$3,birthdate=$4,birthplace=$5,
## deathdate=$6,deathplace=$7,deathcause=$8;
## };
#r_death is relation with
# label=[pid; deathdate; deathplace; deathcause],
# format=[person:1; time:2; space:3; cause:4],
# meaning=procedure_birth;
## meaning={
## $1 has deathdate=$2,deathplace=$3,deathcause=$4;
## #at space=$3,time=$2 {$1 do die with deathcause=$4;};
## };
invocable "procedure_birth"
procedure procedure_birth(rname,nvtab)
#=====================================
local d1,d2,d3,d4,d5,d6,d7,d8
local p,q,cache
case rname of {
"r_birth": {
# initialization
#--------------#
d1 := unparse(nvtab["$1"]) # $1 = pid
d2 := unparse(nvtab["$2"]) # $2 = sex
d3 := unparse(nvtab["$3"]) # $3 = birthname
d4 := unparse(nvtab["$4"]) # $4 = birthdate
d5 := unparse(nvtab["$5"]) # $5 = birthplace
d6 := unparse(nvtab["$6"]) # $6 = deathdate
d7 := unparse(nvtab["$7"]) # $7 = deathplace
d8 := unparse(nvtab["$7"]) # $7 = deathcause
# meaning
#-------#
p := new_person(d1,d2,d3,d4,d5) # new cache
q := new_concept(d1)
put_char("echar",d1,"pid",d1) # $1 with pid=$1
put_char("attr",d1,"deathdate",d6)
put_char("attr",d1,"deathplace",d7)
put_char("attr",d1,"deathcause",d8)
# OLD cache scheme
cache := CACHE[p]
cache.deathdate := d6 # $1 has deathdate=$6
cache.deathplace := d7 # $1 has deathplace=$7
cache.deathcause := d8 # $1 has deathcause=$8
} # end "r_birth"
"r_death": {
# initialization
#--------------#
d1 := unparse(nvtab["$1"]) # $1 = pid
d2 := unparse(nvtab["$2"]) # $2 = deathdate
d3 := unparse(nvtab["$3"]) # $3 = deathplace
d4 := unparse(nvtab["$4"]) # $4 = deathcause
# meaning
#-------#
p := new_person(d1) # new cache
q := new_concept(d1)
put_char("echar",d1,"pid",d1) # $1 with pid=$1
put_char("attr",d1,"deathdate",d2)
put_char("attr",d1,"deathplace",d3)
put_char("attr",d1,"deathcause",d4)
# OLD cache scheme
cache := CACHE[p]
cache.deathdate := d2 # $1 has deathdate=$2
cache.deathplace := d3 # $1 has deathplace=$3
cache.deathcause := d4 # $1 has deathcause=$4
} # end "r_death"
} # end case rname
end
#