Fix loinc designation issue with FormalName (#2865)
* Fix loinc designation issue with FormalName * Changed Loinc designation name to 'FullySpecifiedName'
This commit is contained in:
parent
35d3e3689b
commit
3c598e2ff8
|
@ -2,6 +2,7 @@ package ca.uhn.fhir.jpa.term.loinc;
|
||||||
|
|
||||||
import static org.apache.commons.lang3.StringUtils.isBlank;
|
import static org.apache.commons.lang3.StringUtils.isBlank;
|
||||||
import static org.apache.commons.lang3.StringUtils.trim;
|
import static org.apache.commons.lang3.StringUtils.trim;
|
||||||
|
import static org.apache.commons.lang3.StringUtils.trimToEmpty;
|
||||||
|
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
|
@ -54,18 +55,31 @@ public class LoincLinguisticVariantHandler implements IZipContentsHandlerCsv {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
addDesignation(theRecord, concept, "COMPONENT");
|
// The following should be created as designations for each term:
|
||||||
addDesignation(theRecord, concept, "PROPERTY");
|
// COMPONENT:PROPERTY:TIME_ASPCT:SYSTEM:SCALE_TYP:METHOD_TYP (as colon-separated concatenation - FormalName)
|
||||||
addDesignation(theRecord, concept, "TIME_ASPCT");
|
// SHORTNAME
|
||||||
addDesignation(theRecord, concept, "SYSTEM");
|
// LONG_COMMON_NAME
|
||||||
addDesignation(theRecord, concept, "SCALE_TYP");
|
// LinguisticVariantDisplayName
|
||||||
|
|
||||||
|
//-- add formalName designation
|
||||||
|
StringBuilder formalName = new StringBuilder();
|
||||||
|
formalName.append(trimToEmpty(theRecord.get("COMPONENT") + ":"));
|
||||||
|
formalName.append(trimToEmpty(theRecord.get("PROPERTY") + ":"));
|
||||||
|
formalName.append(trimToEmpty(theRecord.get("TIME_ASPCT") + ":"));
|
||||||
|
formalName.append(trimToEmpty(theRecord.get("SYSTEM") + ":"));
|
||||||
|
formalName.append(trimToEmpty(theRecord.get("SCALE_TYP") + ":"));
|
||||||
|
formalName.append(trimToEmpty(theRecord.get("METHOD_TYP")));
|
||||||
|
|
||||||
addDesignation(theRecord, concept, "METHOD_TYP");
|
concept.addDesignation()
|
||||||
addDesignation(theRecord, concept, "CLASS");
|
.setLanguage(myLanguageCode)
|
||||||
|
.setUseSystem(ITermLoaderSvc.LOINC_URI)
|
||||||
|
.setUseCode("FullySpecifiedName")
|
||||||
|
.setUseDisplay("FullySpecifiedName")
|
||||||
|
.setValue(formalName.toString());
|
||||||
|
|
||||||
|
//-- other designations
|
||||||
addDesignation(theRecord, concept, "SHORTNAME");
|
addDesignation(theRecord, concept, "SHORTNAME");
|
||||||
addDesignation(theRecord, concept, "LONG_COMMON_NAME");
|
addDesignation(theRecord, concept, "LONG_COMMON_NAME");
|
||||||
addDesignation(theRecord, concept, "RELATEDNAMES2");
|
|
||||||
|
|
||||||
addDesignation(theRecord, concept, "LinguisticVariantDisplayName");
|
addDesignation(theRecord, concept, "LinguisticVariantDisplayName");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -478,13 +478,13 @@ public class TerminologyLoaderSvcLoincTest extends BaseLoaderTest {
|
||||||
// Consumer Name
|
// Consumer Name
|
||||||
if (theIncludeConsumerNameAndLinguisticVariants) {
|
if (theIncludeConsumerNameAndLinguisticVariants) {
|
||||||
code = concepts.get("61438-8");
|
code = concepts.get("61438-8");
|
||||||
assertEquals(28, code.getDesignations().size());
|
assertEquals(8, code.getDesignations().size());
|
||||||
verifyConsumerName(code.getDesignations(), "Consumer Name 61438-8");
|
verifyConsumerName(code.getDesignations(), "Consumer Name 61438-8");
|
||||||
verifyLinguisticVariant(code.getDesignations(), "de-AT", "Entlassungsbrief Ärztlich","Ergebnis","Zeitpunkt","{Setting}","Dokument","Dermatologie","DOC.ONTOLOGY","de shortname","de long common name","de related names 2","de linguistic variant display name");
|
verifyLinguisticVariant(code.getDesignations(), "de-AT", "Entlassungsbrief Ärztlich","Ergebnis","Zeitpunkt","{Setting}","Dokument","Dermatologie","DOC.ONTOLOGY","de shortname","de long common name","de related names 2","de linguistic variant display name");
|
||||||
verifyLinguisticVariant(code.getDesignations(), "fr-CA", "Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif","Immunofluorescence","Sérologie","","","","");
|
verifyLinguisticVariant(code.getDesignations(), "fr-CA", "Cellules de Purkinje cytoplasmique type 2 , IgG","Titre","Temps ponctuel","Sérum","Quantitatif","Immunofluorescence","Sérologie","","","","");
|
||||||
verifyLinguisticVariant(code.getDesignations(), "zh-CN", "血流速度.收缩期.最大值","速度","时间点","大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","", "Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语\"cerebral\"指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","");
|
verifyLinguisticVariant(code.getDesignations(), "zh-CN", "血流速度.收缩期.最大值","速度","时间点","大脑中动脉","定量型","超声.多普勒","产科学检查与测量指标.超声","","", "Cereb 动态 可用数量表示的;定量性;数值型;数量型;连续数值型标尺 大脑(Cerebral) 时刻;随机;随意;瞬间 术语\"cerebral\"指的是主要由中枢半球(大脑皮质和基底神经节)组成的那部分脑结构 流 流量;流速;流体 血;全血 血流量;血液流量 速度(距离/时间);速率;速率(距离/时间)","");
|
||||||
code = concepts.get("17787-3");
|
code = concepts.get("17787-3");
|
||||||
assertEquals(19, code.getDesignations().size());
|
assertEquals(6, code.getDesignations().size());
|
||||||
verifyConsumerName(code.getDesignations(), "Consumer Name 17787-3");
|
verifyConsumerName(code.getDesignations(), "Consumer Name 17787-3");
|
||||||
verifyLinguisticVariant(code.getDesignations(), "de-AT", "","","","","","","","","","CoV OC43 RNA ql/SM P","Coronavirus OC43 RNA ql. /Sondermaterial PCR");
|
verifyLinguisticVariant(code.getDesignations(), "de-AT", "","","","","","","","","","CoV OC43 RNA ql/SM P","Coronavirus OC43 RNA ql. /Sondermaterial PCR");
|
||||||
verifyLinguisticVariant(code.getDesignations(), "fr-CA", "Virus respiratoire syncytial bovin","Présence-Seuil","Temps ponctuel","XXX","Ordinal","Culture spécifique à un microorganisme","Microbiologie","","","","");
|
verifyLinguisticVariant(code.getDesignations(), "fr-CA", "Virus respiratoire syncytial bovin","Présence-Seuil","Temps ponctuel","XXX","Ordinal","Culture spécifique à un microorganisme","Microbiologie","","","","");
|
||||||
|
@ -958,61 +958,29 @@ public class TerminologyLoaderSvcLoincTest extends BaseLoaderTest {
|
||||||
String methodType, String theClass, String theShortName, String theLongCommonName, String theRelatedName2,
|
String methodType, String theClass, String theShortName, String theLongCommonName, String theRelatedName2,
|
||||||
String theLinguisticVariantDisplayName) {
|
String theLinguisticVariantDisplayName) {
|
||||||
|
|
||||||
TermConceptDesignation componentDes = null;
|
TermConceptDesignation formalNameDes = null;
|
||||||
TermConceptDesignation propertyDes = null;
|
|
||||||
TermConceptDesignation timeAspctDes = null;
|
|
||||||
TermConceptDesignation systemDes = null;
|
|
||||||
TermConceptDesignation scaleTypDes = null;
|
|
||||||
|
|
||||||
TermConceptDesignation methodTypDes = null;
|
|
||||||
TermConceptDesignation classDes = null;
|
|
||||||
TermConceptDesignation shortNameDes = null;
|
TermConceptDesignation shortNameDes = null;
|
||||||
TermConceptDesignation longCommonNameDes = null;
|
TermConceptDesignation longCommonNameDes = null;
|
||||||
TermConceptDesignation relatedNames2Des = null;
|
|
||||||
|
|
||||||
TermConceptDesignation linguisticVariantDisplayNameDes = null;
|
TermConceptDesignation linguisticVariantDisplayNameDes = null;
|
||||||
|
|
||||||
for (TermConceptDesignation designation : designationList) {
|
for (TermConceptDesignation designation : designationList) {
|
||||||
if (theLanguage.equals(designation.getLanguage())) {
|
if (theLanguage.equals(designation.getLanguage())) {
|
||||||
|
|
||||||
if ("COMPONENT".equals(designation.getUseDisplay()))
|
if ("FullySpecifiedName".equals(designation.getUseDisplay()))
|
||||||
componentDes = designation;
|
formalNameDes = designation;
|
||||||
if ("PROPERTY".equals(designation.getUseDisplay()))
|
|
||||||
propertyDes = designation;
|
|
||||||
if ("TIME_ASPCT".equals(designation.getUseDisplay()))
|
|
||||||
timeAspctDes = designation;
|
|
||||||
if ("SYSTEM".equals(designation.getUseDisplay()))
|
|
||||||
systemDes = designation;
|
|
||||||
if ("SCALE_TYP".equals(designation.getUseDisplay()))
|
|
||||||
scaleTypDes = designation;
|
|
||||||
|
|
||||||
if ("METHOD_TYP".equals(designation.getUseDisplay()))
|
|
||||||
methodTypDes = designation;
|
|
||||||
if ("CLASS".equals(designation.getUseDisplay()))
|
|
||||||
classDes = designation;
|
|
||||||
if ("SHORTNAME".equals(designation.getUseDisplay()))
|
if ("SHORTNAME".equals(designation.getUseDisplay()))
|
||||||
shortNameDes = designation;
|
shortNameDes = designation;
|
||||||
if ("LONG_COMMON_NAME".equals(designation.getUseDisplay()))
|
if ("LONG_COMMON_NAME".equals(designation.getUseDisplay()))
|
||||||
longCommonNameDes = designation;
|
longCommonNameDes = designation;
|
||||||
if ("RELATEDNAMES2".equals(designation.getUseDisplay()))
|
|
||||||
relatedNames2Des = designation;
|
|
||||||
|
|
||||||
if ("LinguisticVariantDisplayName".equals(designation.getUseDisplay()))
|
if ("LinguisticVariantDisplayName".equals(designation.getUseDisplay()))
|
||||||
linguisticVariantDisplayNameDes = designation;
|
linguisticVariantDisplayNameDes = designation;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
verifyDesignation(componentDes, ITermLoaderSvc.LOINC_URI, "COMPONENT", theComponent);
|
|
||||||
verifyDesignation(propertyDes, ITermLoaderSvc.LOINC_URI, "PROPERTY", theProperty);
|
|
||||||
verifyDesignation(timeAspctDes, ITermLoaderSvc.LOINC_URI, "TIME_ASPCT", theTimeAspct);
|
|
||||||
verifyDesignation(systemDes, ITermLoaderSvc.LOINC_URI, "SYSTEM", theSystem);
|
|
||||||
verifyDesignation(scaleTypDes, ITermLoaderSvc.LOINC_URI, "SCALE_TYP", theScaleTyp);
|
|
||||||
|
|
||||||
verifyDesignation(methodTypDes, ITermLoaderSvc.LOINC_URI, "METHOD_TYP", methodType);
|
verifyDesignation(formalNameDes, ITermLoaderSvc.LOINC_URI, "FullySpecifiedName", theComponent+":"+theProperty+":"+theTimeAspct+":"+theSystem+":"+theScaleTyp+":"+methodType);
|
||||||
verifyDesignation(classDes, ITermLoaderSvc.LOINC_URI, "CLASS", theClass);
|
|
||||||
verifyDesignation(shortNameDes, ITermLoaderSvc.LOINC_URI, "SHORTNAME", theShortName);
|
verifyDesignation(shortNameDes, ITermLoaderSvc.LOINC_URI, "SHORTNAME", theShortName);
|
||||||
verifyDesignation(longCommonNameDes, ITermLoaderSvc.LOINC_URI, "LONG_COMMON_NAME", theLongCommonName);
|
verifyDesignation(longCommonNameDes, ITermLoaderSvc.LOINC_URI, "LONG_COMMON_NAME", theLongCommonName);
|
||||||
verifyDesignation(relatedNames2Des, ITermLoaderSvc.LOINC_URI, "RELATEDNAMES2", theRelatedName2);
|
|
||||||
|
|
||||||
verifyDesignation(linguisticVariantDisplayNameDes, ITermLoaderSvc.LOINC_URI, "LinguisticVariantDisplayName", theLinguisticVariantDisplayName);
|
verifyDesignation(linguisticVariantDisplayNameDes, ITermLoaderSvc.LOINC_URI, "LinguisticVariantDisplayName", theLinguisticVariantDisplayName);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue