Exemple #1
0
def __compute_rel_weight_next(rel_specs):
    weight = 0
    date = 0
    relmod_update = 0
    relmod_type = 0

    if (debug):
        sys.stdout.write("DATE_VERSION  = %s\n" % rel_specs['DATE_VERSION'])
        sys.stdout.write("RELMOD_UPDATE = %s\n" % rel_specs['RELMOD_UPDATE'])
        sys.stdout.write("RELMOD_TYPE   = %s\n" % rel_specs['RELMOD_TYPE'])

    if (rel_specs['DATE_VERSION'] != ''):
        date = rel_specs['DATE_VERSION'].lstrip("rc")
        date = int(date.translate(None, "-"))

    if (rel_specs['RELMOD_UPDATE'] != ''):
        mod = rel_specs['RELMOD_UPDATE']
        if (mod == ""):
            mod = 0
        else:
            mod = int(mod)
        relmod = int(mod)

    if (rel_specs['RELMOD_TYPE'] != ''):
        rtype = rel_specs['RELMOD_TYPE']
        if ("c" in rtype):
            relmod_type = relmod_type + 6
        if ("u" in rtype):
            relmod_type = relmod_type + 7
        if ("p" in rtype):
            relmod_type = relmod_type + 8
        if ("n" in rtype):
            relmod_type = relmod_type + 9
        if ("s" in rtype):
            relmod_type = relmod_type + 10

    weight = (999                << 32) + \
             (int(date)          << 16) + \
             (int(relmod_update) << 8 ) + \
             (int(relmod_type))

    return weight
Exemple #2
0
print "Use today's date? ", TODAY
use_today = raw_input("(Default: Yes) [Y/N]: ")

if use_today != '':
    USE_TODAY = False

if USE_TODAY == True:
    date = TODAY
    MY_STATS['date'] = str(date)
    MY_STATS['month'] = date.strftime("%B")
else:
    date = raw_input("\nEnter date (YYYY-MM-DD): ")
    month = raw_input("Month (full name): ")
    MY_STATS['date'] = date
    MY_STATS['month'] = month
    MY_DICT = date.translate(None, '-')

##
# Blood pressure stats
##
print "\n~~~ Blood Pressure ~~~"
bp_sys = raw_input("   Systolic: ")
bp_dia = raw_input("  Diastolic: ")
bp_bpm = raw_input("Pulse (bpm): ")

MY_STATS['bp_sys'] = int(bp_sys)
MY_STATS['bp_dia'] = int(bp_dia)
MY_STATS['bp_bpm'] = int(bp_bpm)

##
# Glucose level