Search



Page tree

  

This section contains examples of the SQL statements used to imports data from a component release files in the appropriate database table.  Before importing the tables must be created (see 5.2. Creating Tables for Components and 5.3. Creating Tables for Reference Sets).

Sample SQL Code for Importing from Full Release

Note

The code shown below provides illustrative examples only. For full details download an review the import script. For details see A.1 Download the SNOMED CT Example Database Package.

Import Concepts from Full Release

Import Concept File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Concept_Full_INT_[RELEASE-DATE].txt'
INTO TABLE `full_concept`
LINES TERMINATED BY '\r\n'
 IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`definitionStatusId`);

Import Descriptions from Full Release

Import Description File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Description_Full-en_INT_[RELEASE-DATE].txt'
INTO TABLE `full_description`
LINES TERMINATED BY '\r\n'
 IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`conceptId`,`languageCode`,`typeId`,`term`,`caseSignificanceId`);

Import Relationships from Full Release

Import Relationship File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Terminology/sct2_Relationship_Full_INT_[RELEASE-DATE].txt'
INTO TABLE `full_relationship`
LINES TERMINATED BY '\r\n'
 IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`sourceId`,`destinationId`,`relationshipGroup`,`typeId`,`characteristicTypeId`,`modifierId`);

Import Simple Refsets from Full Release

Import a Simple Refset File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Content/der2_Refset_SimpleFull_INT_[RELEASE-DATE].txt'
INTO TABLE `full_refset_simple`
LINES TERMINATED BY '\r\n'
 IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refSetId`,`referencedComponentId` );

Import Language Refsets from Full Release

Import a Language Refset File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Language/der2_cRefset_LanguageFull-en_INT_$RELDATE.txt'
INTO TABLE `full_refset_Language`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refsetId`,`referencedComponentId`,`acceptabilityId`);

Import Extended Map Refsets from Full Release

Import an Extended Map Refset File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Full/Refset/Map/der2_iisssccRefset_ExtendedMapFull_INT_$RELDATE.txt'
INTO TABLE `full_refset_ExtendedMap`
LINES TERMINATED BY '\r\n'
IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refsetId`,`referencedComponentId`,`mapGroup`,`mapPriority`,`mapRule`,`mapAdvice`,`mapTarget`,`correlationId`,`mapCategoryId`);


Sample SQL Code for Importing from a Snapshot Release

Note

The code shown below provides illustrative examples only to show the minor difference between the code for importing the snapshot compared to the full release. For full details download an review the import script. For details see A.1 Download the SNOMED CT Example Database Package.

Import Concepts from Snapshot Release

Import Concept File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Snapshot/Terminology/sct2_Concept_Snapshot_INT_[RELEASE-DATE].txt'
INTO TABLE `snap_concept`
LINES TERMINATED BY '\r\n'
 IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`definitionStatusId`);

Import Simple Refsets from Snapshot Release

Import a Simple Refset File
LOAD DATA LOCAL INFILE '[RELEASE-FILE-PATH]/[RELEASE-PACKAGE-VERSION-NAME]/Snapshot/Refset/Content/der2_Refset_SimpleSnapshot_INT_[RELEASE-DATE].txt'
INTO TABLE `snap_refset_simple`
LINES TERMINATED BY '\r\n'
 IGNORE 1 LINES
(`id`,`effectiveTime`,`active`,`moduleId`,`refSetId`,`referencedComponentId`);

Feedback
  • No labels