4140-upload-terminology-does-not-allow-snomed-ct-canada-edition-zip-file-to-load-due-to-a-different-file-name (#4144)

* Test + Implementation of the Solution

* Changes made based on comments
This commit is contained in:
karneet1212 2022-10-19 11:33:21 -04:00 committed by GitHub
parent 69d55b7184
commit a6ed393969
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 49 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
type: add
issue: 4140
jira: SMILE-673
title: "For SNOMED CT, upload-terminology now supports both Canadian and International edition's file names for the SCT Description File"

View File

@ -165,7 +165,7 @@ public class TermLoaderSvcImpl implements ITermLoaderSvc {
static final String IMGTHLA_HLA_XML = "hla.xml";
static final String CUSTOM_CODESYSTEM_JSON = "codesystem.json";
private static final String SCT_FILE_CONCEPT = "Terminology/sct2_Concept_Full_";
private static final String SCT_FILE_DESCRIPTION = "Terminology/sct2_Description_Full-en";
private static final String SCT_FILE_DESCRIPTION = "Terminology/sct2_Description_Full";
private static final String SCT_FILE_RELATIONSHIP = "Terminology/sct2_Relationship_Full";
private static final String CUSTOM_CODESYSTEM_XML = "codesystem.xml";

View File

@ -96,6 +96,29 @@ public class TerminologyLoaderSvcSnomedCtTest extends BaseLoaderTest {
assertThat(allCodes, hasItem("126816002"));
}
@Test
public void testLoadSnowmedCtWithCanadianEditionFileNamingConvention() throws Exception {
myFiles.addFileZip("/sct/", "sct2_Concept_Full_INT_20160131.txt");
myFiles.addFileZip("/sct/", "sct2_Description_Full_INT_20160131.txt");
myFiles.addFileZip("/sct/", "sct2_Identifier_Full_INT_20160131.txt");
myFiles.addFileZip("/sct/", "sct2_Relationship_Full_INT_20160131.txt");
myFiles.addFileZip("/sct/", "sct2_StatedRelationship_Full_INT_20160131.txt");
mySvc.loadSnomedCt(myFiles.getFiles(), mySrd);
verify(myTermCodeSystemStorageSvc).storeNewCodeSystemVersion(any(CodeSystem.class), myCsvCaptor.capture(), any(RequestDetails.class), anyList(), anyList());
TermCodeSystemVersion csv = myCsvCaptor.getValue();
TreeSet<String> allCodes = toCodes(csv, true);
ourLog.info(allCodes.toString());
assertThat(allCodes, hasItem("116680003"));
assertThat(allCodes, not(hasItem("207527008")));
allCodes = toCodes(csv, false);
ourLog.info(allCodes.toString());
assertThat(allCodes, hasItem("126816002"));
}
/**
* This is just for trying stuff, it won't run without
* local files external to the git repo

View File

@ -0,0 +1,20 @@
id effectiveTime active moduleId conceptId languageCode typeId term caseSignificanceId
101013 20020131 1 900000000000207008 126813005 en 900000000000013009 ROOT1 900000000000020002
102018 20020131 1 900000000000207008 126814004 en 900000000000013009 ROOT2 900000000000020002
103011 20020131 1 900000000000207008 126815003 en 900000000000013009 ROOT1_1 900000000000020002
104017 20020131 1 900000000000207008 126816002 en 900000000000013009 ROOT1_2 900000000000020002
105016 20020131 1 900000000000207008 126817006 en 900000000000013009 ROOT1_1_1 900000000000020002
106015 20020131 1 900000000000207008 126818001 en 900000000000013009 Neoplasm of cervical esophagus 900000000000020002
107012 20020131 1 900000000000207008 126819009 en 900000000000013009 Neoplasm of thoracic esophagus 900000000000020002
108019 20020131 1 900000000000207008 126820003 en 900000000000013009 Neoplasm of abdominal esophagus 900000000000020002
110017 20020131 1 900000000000207008 126822006 en 900000000000013009 Neoplasm of middle third of esophagus 900000000000020002
181114011 20020131 1 900000000000207008 116680003 en 900000000000013009 Is a (attribute) 900000000000020002
317927012 20020131 1 900000000000207008 207527008 en 900000000000013009 [D]Old age 900000000000017005
317927012 20080731 1 900000000000207008 207527008 en 900000000000013009 [D]Old age 900000000000020002
317927012 20090731 1 900000000000207008 207527008 en 900000000000013009 [D]Old age 900000000000017005
593143017 20020131 1 900000000000207008 207527008 en 900000000000003001 [D]Old age (context-dependent category) 900000000000020002
593143017 20030731 1 900000000000207008 207527008 en 900000000000003001 [D]Old age (context-dependent category) 900000000000017005
593143017 20060731 0 900000000000207008 207527008 en 900000000000003001 [D]Old age (context-dependent category) 900000000000017005
1222549013 20020731 1 900000000000207008 207527008 en 900000000000013009 [D]Senility 900000000000020002
2608974012 20060731 1 900000000000207008 207527008 en 900000000000003001 [D]Old age (situation) 900000000000020002
2608974012 20080731 1 900000000000207008 207527008 en 900000000000003001 [D]Old age (situation) 900000000000017005