Added "lab" in for medical [sti] tests.

This commit is contained in:
Neil 2023-09-05 21:49:53 -07:00
parent 5d111433c3
commit 81fc10966d
4 changed files with 24 additions and 2 deletions

View File

@ -1 +1 @@
../../journal/
../../../Documents/journal/

View File

@ -147,7 +147,7 @@ struct scan {
} edits;
struct linepair_tree dreams;
struct linekvpair_tree contacts, books, tvs, movies, ideas,
vaccines, medications, mails, couches;
vaccines, medications, labs, mails, couches;
struct linekvdate_tree froms;
struct linekvmoney_tree taxes, incomes;
struct glider_tree gliders;

View File

@ -256,6 +256,7 @@ static int scan_day(struct scan *const scan, union date32 date,
<bracket> "idea: " :=> idea
<bracket> "vaccine: " :=> vaccine
<bracket> "medication: " :=> medication
<bracket> "lab: " :=> lab
<bracket> "tax: " :=> tax
<bracket> "in: " :=> income
<bracket> "mail: " :=> mail
@ -436,6 +437,22 @@ static int scan_day(struct scan *const scan, union date32 date,
continue;
}
<lab> * { fail = "lab unrecognized"; goto catch; }
<lab> @s0 bralabel @s1 "]" => input_text {
const union line64 key = { { (uint32_t)line, date } };
struct kvpair *pair;
switch(linekvpair_tree_bulk_assign(&scan->labs, key, &pair)) {
case TREE_PRESENT: fail = "duplicate"; case TREE_ERROR: goto catch;
case TREE_ABSENT: break;
}
pair->key.a = s0, pair->key.b = s1;
pair->value.a = pair->value.b = 0;
input.future = yycnewline, input.pair = &pair->value;
fprintf(stderr, "%s:%zu: new lab <<%.*s>>.\n",
datestr, line, (int)(s1 - s0), s0);
continue;
}
<tax> * { fail = "tax unrecognized"; goto catch; }
<tax> @s0 bralabel @s1 "]" => input_money {
const union line64 key = { { (uint32_t)line, date } };
@ -989,6 +1006,7 @@ void scan_(struct scan *const scan) {
linekvmoney_tree_(&scan->taxes);
linekvdate_tree_(&scan->froms);
linekvpair_tree_(&scan->couches);
linekvpair_tree_(&scan->labs);
linekvpair_tree_(&scan->medications);
linekvpair_tree_(&scan->vaccines);
linekvpair_tree_(&scan->ideas);
@ -1070,6 +1088,7 @@ struct scan scan(struct journal *const jrnl) {
|| !linekvpair_tree_bulk_finish(&scan.ideas)
|| !linekvpair_tree_bulk_finish(&scan.vaccines)
|| !linekvpair_tree_bulk_finish(&scan.medications)
|| !linekvpair_tree_bulk_finish(&scan.labs)
|| !linekvpair_tree_bulk_finish(&scan.couches)
|| !linekvdate_tree_bulk_finish(&scan.froms)
|| !linekvmoney_tree_bulk_finish(&scan.taxes)

3
time.txt Normal file
View File

@ -0,0 +1,3 @@
set xdata time
set timefmt myTimeFmt
set xrange ['2000-01-01':*]