wes_pmbb__enc.csv
Add Column
Add Node/Literal
Literal Node: wes_pmbb__enc.csv
Literal Type: NA
Language: NA
isUri: false
PyTransforms
enc_uri
From column: ENCOUNTER_PACK_ID
import uuid
temp = uuid.uuid4().hex
return "encounter/" + temp
encoutner_reg_uri_string
From column: PROTOCOL
# return("http://transformunify.org/ontologies/TURBO_0000421")
bb_protocol = getValue("PROTOCOL")
if (bb_protocol == "CGI") :
return("http://transformunify.org/ontologies/TURBO_0000420")
elif (bb_protocol == "PmbbBlood") :
return("http://transformunify.org/ontologies/TURBO_0000422")
elif (bb_protocol == "PmbbTissue") :
return("http://transformunify.org/ontologies/TURBO_0000423")
else:
return("")
karma_height_cm
From column: HEIGHT_STANDARD_FEET
inpart = float(getValue("HEIGHTINCHES"))
#footpart = float(getValue("HEIGHT_STANDARD_FEET"))
footpart = 0
totinches = inpart + (footpart * 12)
cm = totinches * 2.54
return(str(cm))
karma_weight_kg
From column: WEIGHT_STANDARD
lbs = float(getValue("WEIGHTLBS"))
kgs = lbs / 2.205
return(str(kgs))
karma_bmi
From column: WEIGHT_STANDARD
inval = str(getValue("HEIGHT_STANDARD_INCHES"))
if inval.isnumeric():
inpart = float(inval)
else:
inpart = 0.0
footpart = float(getValue("HEIGHT_STANDARD_FEET"))
totinches = inpart + (footpart * 12)
cm = totinches * 2.54
lbs = float(getValue("WEIGHT_STANDARD"))
kgs = lbs / 2.20462262185
bmi = kgs * 10000 / ( cm * cm )
return(str(bmi))
encounter_date_xsd
From column: recruitment_date_shift
from datetime import datetime
datestring = getValue("ENCOUNTERDATE")
datetokens = datestring .split('/')
intarray = [int(numeric_string) for numeric_string in datetokens]
if intarray[2] < 100:
testyear = (int(str(datetime.now().year)[:1]))*1000 + intarray[2]
testdatestring = str(intarray[0])+'/'+str(intarray[1])+'/'+str(testyear)
testdateobj = datetime.strptime(testdatestring, '%m/%d/%Y')
if testdateobj > datetime.now():
intarray[2] += 1900
else:
intarray[2] += 2000
finaldatestring = str(intarray[0])+'/'+str(intarray[1])+'/'+str(intarray[2])
finaldateobj = datetime.strptime(finaldatestring, '%m/%d/%Y')
back2string = finaldateobj.strftime("%Y-%m-%d")
return(back2string)
Selections
Semantic Types
Column | Property | Class |
---|---|---|
CALCULATEDBMI | turbo:TURBO_0000635 |
turbo:TURBO_00005271 |
ENCOUNTERDATE | turbo:TURBO_0000624 |
turbo:TURBO_00005271 |
PACKETID | turbo:TURBO_0000628 |
turbo:TURBO_00005271 |
PROTOCOL | turbo:TURBO_0000629 |
turbo:TURBO_00005271 |
enc_uri | uri |
turbo:TURBO_00005271 |
encounter_date_xsd | turbo:TURBO_0000625 |
turbo:TURBO_00005271 |
encoutner_reg_uri_string | turbo:TURBO_0000630 |
turbo:TURBO_00005271 |
karma_height_cm | turbo:TURBO_0000626 |
turbo:TURBO_00005271 |
karma_weight_kg | turbo:TURBO_0000627 |
turbo:TURBO_00005271 |
Links
From | Property | To |
---|---|---|
turbo:TURBO_00005271 |
turbo:TURBO_0000623 |
wes_pmbb__enc.csv |