Create and map the multiple database schemas
- Last Updated: June 29, 2019
- 3 minute read
- Corticon
- Documentation
Note: Using the sample: For the Multiple
Database sample, you need to have executed the Corticon SQL scripts
patient, adc and
cms for your database in your database
management tool's editor. The metadata, primary keys, and join expressions are
already mapped to the database.Create the schema in the databases
Typically, the database administrator creates the tables in the namespaces, and then the columns with their data types, the declared primary key, and any joins between tables.
Create the entities and their identity, then their attributes, and associations
- Define the database tables that will participate in rules as
Corticon entities. For the sample, the first table is
Patient:
- Add the required columns for that table as Corticon attributes with corresponding data types.
- Specify the Primary Key (PK) in the database table as the
Entity Identity by clicking the Entity Identity Property
Value to open its menu, and then choose from the listed attributes, as shown:

- Add additional tables, such as the sample's
Treatmenttable:
- Specify its Primary Key (PK) in the database table as the
Entity Identity by clicking the Entity Identity Property
Value to open its menu, and then choose from the listed attributes, as shown:

- The Treatment entity also links to another database through the
attribute
medicalCode
- Each
medicalCodeneeds to link to the Primary Key (PK)TreatmentCodein the tableTreatmentDetailsin theCMSDetaildatabase
- In Corticon Studio on the Vocabulary's Datasource tab, click METADATA: Import. The mapping metadata from the database is added into the Vocabulary for the Entities (tables), Attributes (columns), and Associations (join expressions). If the imported tables and columns do not align with entities and their attributes, those values will require manual mapping.
- One such case is noted here. SmartMatching won't infer the table name through a link based on an
attribute so you need to pull down the Table Name
options to choose
CMSDetail.dbo.TreatmentDetailstable, as illustrated:
If other imported tables and columns do not align with entities and their attributes, those values will require manual mapping. For more about mapping, see Mapping ADC database metadata.