Renamed DataGenerator to CdsDataGenrator - as the behaviour is highly specific to CDS FHIR generation so we might add other types of data generators.
Refactored OutputDataGenerator to CdsFhirData in models/data with default empty dict for context field and renamed resource field to prefetch for consistency. Also set default model_dump behaviour - exclude_none=True, exclude_unset=True, by_alias=True
More explicit function I/O in usage for service and client functions:
ehr client must return CdsFhirData Pydantic model
service takes in CdsRequest Pydantic model (although through type hinting it can also dynamically convert this model to str or Dict, but it's more of a fallback as it's better to keep consistent and use the pydantic model)
service returns a list of Card Pydantic model (if a single Card is returned, the wrapper will put it in a list)
Updated documentation
shorten sandbox id in save name
Tasks
[x] Make service func io more explicit
[x] Make client func io more explicit
[x] Raise errors to check correct data type is being passed
Addresses https://github.com/dotimplement/HealthChain/issues/30
CHANGES
DataGenerator
toCdsDataGenrator
- as the behaviour is highly specific to CDS FHIR generation so we might add other types of data generators.OutputDataGenerator
toCdsFhirData
inmodels/data
with default empty dict forcontext
field and renamedresource
field toprefetch
for consistency. Also set defaultmodel_dump
behaviour -exclude_none=True, exclude_unset=True, by_alias=True
CdsFhirData
Pydantic modelCdsRequest
Pydantic model (although through type hinting it can also dynamically convert this model tostr
orDict
, but it's more of a fallback as it's better to keep consistent and use the pydantic model)Card
Pydantic model (if a singleCard
is returned, the wrapper will put it in a list)Tasks