## 3 Materials and Methods
The augmented archetype comprises the initial EHR archetype and the augmentation archetype (step 7 in Figure 2). An approach to building the augmented archetype is to specialize the initial EHR archetype by including a slot reference to embed the augmentation archetype. The path to the slot reference must be manually selected to ensure that the resulting archetype preserves the original meaning. However, once the slot location is chosen, the modeling of the augmented archetype can be automatic based on the initial EHR archetype, the path to the slot reference, and the augmentation archetype (whose root component establishes the data type of the slot reference). To assist in the process of choosing the proper slot location for the augmentation archetype, this work introduces an algorithm (Figure 7) to identify which components of the initial EHR archetype are valid to contain the slot reference. The result of this algorithm is a set of candidate paths ordered by proximity to the EOIs in the initial EHR archetype:  
**Require**  
- Root_Type: Type of the root element in the augmentation archetype  
- EHR_Archetype_Elements: The set of elements in the EHR archetype  
- EOI_Paths: Paths to the EOIs in the EHR archetype  
- Preferred_Slot_Path: Slot location provided by the user (Optional, it may be empty)  
Returns  
- Slot_Locations: The candidate path(s) to hold the augmentation archetype  
Initialize  
- Slot_Paths: Set of candidate paths for the slot location (initially empty)  
for each e EHR_Archetype_Elements do  
If e.type can hold an element of type Root_Type  
and e.max_cardinality > e.cardinality then  
Slot_Paths.add(e.path)  
end if  
end for
If Slot_Paths contains Feferred_Slot_Path then  
Slot_Locations < Feferred_Slot_Path  
else  
Slot_Locations < sortByProximity(Slot_Paths, EOI_Paths)  
end if  
return Slot_Locations  
Figure 6: (a) A LinkEHR visualization of the augmentation archetype _CEN-EN13606-CLUSTER_DrugDrugInteraction.v1_ for drug–drug interactions of the example in section D. (b) an instance of the _CEN-EN13606-CLUSTER_DrugDrugInteraction.v1_ augmentation archetype presented in HTML and holding drug–drug interactions for _Filgrastim_ (i.e., the augmentation content resulting from the example in section C). Figure 7: Proposed algorithm to determine components in the initial EHR archetype candidate to include the slot reference for the augmentation content. The returned value _Slot_Locations_ includes a set of candidate paths from the initial EHR archetype that are valid to hold the augmentation archetype. The path for the slot reference to the augmentation archetype must be selected manually from the _Slot_Locations_ set of paths. Next, the augmented archetype can be modeled as a specialization of the initial EHR archetype, containing the same elements than the initial EHR archetype plus an additional slot for the augmentation archetype. The LinkEHR platform provides tools to model the augmented archetype, and to define mapping specifications between the initial EHR archetype, the augmentation archetype, and the augmented archetype (i.e., data exchange 2 at schema level in Figure 1). In this case, the mapping specifications are based on identity functions and slot inclusions. Finally, the LinkEHR platform serves to compile the mapping specifications into a XQuery script, whose execution transforms instances of the initial EHR archetype and the normalized augmentation content into an augmented EHR extract, expressed as an instance of the augmented archetype (i.e., data exchange 2 at data level in Figure 1). Note that an augmented archetype could be modeled to hold several augmentation archetypes by including additional slots for them in the modeling stage. In such cases, it would be required to repeat the steps in section E for each augmentation archetype to be included in the augmented archetype.