Closed schuemie closed 6 months ago
I see your thought process....the concept attribute class doesn't take a conceptSet class, it takes on a concept class which is constructed on-the-fly by the function. You just need the concept id as the input for unit
.
Better documentation is required....will work on that. Also, will think about vocabulary helper functions to find the concept id that is appropriate to the measurement, something that is non-trivial.
Try this:
essentialHypertension <- cs(
descendants(320128),
exclude(descendants(3012888)),
name = "Essential hypertension"
)
sbp <- cs(3004249, name = "SBP")
dbp <- cs(3012888, name = "DBP")
#mmHg <- cs(8876, name = "mmHg")
hypertensionCohort <- cohort(
entry = entry(
conditionOccurrence(essentialHypertension),
measurement(sbp, valueAsNumber(gte(130)), unit(8876)),
measurement(dbp, valueAsNumber(gte(80)), unit(8876))
),
exit = exit(
endStrategy = observationExit()
)
)
Thanks!
I'm struggling a bit to figure our what type of values can be used as arguments. Maybe there's a better way to document this?
Anyway, maybe this example could be added to the examples vignette? (Which I find very useful)
yeah myself and @rbcavanaugh (who has offered to help with some documentation) will add some more examples of how to use Capr. Sorry about that, planning on having a bit more time to dedicate to Capr coming up!
I can't figure out how to specify a unit for a measurement. Here's my current code:
which will throw this error: