Here is the scenario -
l have a Patient dataset and a Provider dataset. Both datasets are generated from schemas that have a State column. I would like to add a Preferred Provider column to the Patient schema, that populates a provider name from the Provider Dataset - the caveat is instead of being random, I would like to populate the a provider whose state matches the patient state. Is there a way to do this ?
Hi @mukundan.agaram
One option is to do a join and treat the State as a shared key, for example:
from_dataset("Provider","Provider_Name",schema_State_field_name:dataset_State_field_name)
It should pick a random value from the matches. See here Can I lookup a value in one dataset using a field in another? for more details of this functionality.
Hi @mp_np
I tried the approach and I am getting this error
Error evaluating from_dataset(“TristatesAndAffiliateProviders”, “name”, “{“state”:“MN”}”): undefined method `lists’ for nil:NilClass
Hi @mp_np,
I got it to work. I needed to use from_dataset() with just plain Formula instead of DatasetColumn with Formula. That seemed to do the trick.