Hands-On Healthcare Data by Andrew Nguyen

Hands-On Healthcare Data by Andrew Nguyen

Author:Andrew Nguyen [Andrew Nguyen]
Language: eng
Format: epub
Publisher: O'Reilly Media, Inc.
Published: 2022-08-15T00:00:00+00:00


Example 4-14. TypeDB Schema for Prescriptions

prescription sub relation, relates patient, relates prescribed_drug, owns startdate, owns enddate; druginstance sub entity, plays prescription:prescribed_drug, owns startdate, owns enddate, owns drug_type, owns drug, owns drug_name_poe, owns drug_name_generic, owns formulary_drug_cd, owns gsn, owns ndc, owns prod_strength, owns dose_val_rx, owns dose_unit_rx, owns form_val_disp, owns form_unit_disp, owns route;

I’ve split the original definition of the PRESCRIPTIONS table into an entity and a relation. The druginstance entity captures all of the drug information (e.g., name, dose, route, etc.) while the prescription relation captures the details of the prescription itself. Within the relation, we define two roles: patient and prescribed_drug. Roles allow TypeDB to capture and model an additional layer of context—the role that an entity plays within a particular relation.



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.