コード例 #1
0
	def getAUIMapDict(self):
		"""
		Returns:
			dict: {AUI: {'code': code, 'eng': ENG, 'cns': CNS)}
		"""
		ICD10_CNSGOV = readICD10_4Digit(DATA_PATH+'/thesaurus/cn/ICD-10/cn-gov/4位代码亚目表(ICD-10).xls')
		ICD10CM_CNSTW = json.load(open(DATA_PATH+'/thesaurus/cn/ICD-10/cn-tw/CNSTW.json'))
		ICD10CM_ENGCDC = readICD_ENSCDC_TXT(DATA_PATH+'/thesaurus/en/ICD10/CDC/icd10cm_order_2017.txt')
		UMLSDataList = readUMLS_ENG(DATA_PATH+'/umlsMT/umls/MRCONSO.RRF')
		mapDict = {}
		for uTermDict in UMLSDataList:
			if (uTermDict['SAB']== 'ICD10AM' or uTermDict['SAB'] == 'ICD10CM' or uTermDict['SAB'] == 'ICD10' or uTermDict['SAB'] == 'ICD10AMAE'):
				AUI = uTermDict['AUI']
				code = uTermDict['CODE']
				ENG = uTermDict['STR']
				CNS = None
				if code in ICD10_CNSGOV:		#优先采用ICD10_CNSGOV
					if code in ICD10CM_ENGCDC:		#能双保险验证则双保险验证
						if sameTerm(ENG, ICD10CM_ENGCDC[code]):
							CNS = ICD10_CNSGOV[code]
					else:
						CNS = ICD10_CNSGOV[code]
				elif code in ICD10CM_CNSTW:
					if sameTerm(ENG, ICD10CM_CNSTW[code]['eng']):		#双保险
						CNS = ICD10CM_CNSTW[code]['cns']
				if CNS:
					mapDict[AUI] = ({'code': code, 'eng': ENG, 'cns': CNS})
		return mapDict
コード例 #2
0
    def getAUIMapDict(self):
        """
		Returns:
			dict: {AUI: {'code': code, 'eng': ENG, 'cns': CNS)}
		"""
        SNOMEDDataDict = readSNOMED_CNSCMIA_TXT(
            DATA_PATH + '/thesaurus/cn/SNOMED/CMIA/英汉对照国际医学规范术语全集-精选本.txt')
        UMLSDataList = readUMLS_ENG(DATA_PATH + '/umlsMT/umls/MRCONSO.RRF')
        mapDict = {}
        mapDict.update(self.getAUIMapDict1(SNOMEDDataDict, UMLSDataList))
        mapDict.update(self.getAUIMapDict2(SNOMEDDataDict, UMLSDataList))
        return mapDict
コード例 #3
0
    def getAUIMapDict(self):
        """
		Returns:
			dict: {AUI: {'code': code, 'eng': ENG, 'cns': CNS)}
		"""
        SNOMEDDataDict = readSNOMED_CNSBDWK_XLSX(
            DATA_PATH + '/thesaurus/cn/SNOMED/BDWK/snomed对照表.xlsx')
        UMLSDataList = readUMLS_ENG(DATA_PATH + '/umlsMT/umls/MRCONSO.RRF')
        mapDict = {}
        mapDict.update(self.getAUIMapDict1(SNOMEDDataDict, UMLSDataList))
        mapDict.update(self.getAUIMapDict2(SNOMEDDataDict, UMLSDataList))
        return mapDict
コード例 #4
0
	def getAUIMapDict(self):
		"""
		Returns:
			dict: {AUI: {'code': code, 'eng': ENG, 'cns': CNS)}
		"""
		HPODataDict = readCHPO(DATA_PATH+'/thesaurus/cn/HPO/chpo.2016-10.xls')
		UMLSDataList = readUMLS_ENG(DATA_PATH+'/umlsMT/umls/MRCONSO.RRF')
		mapDict = {}
		for uTermDict in UMLSDataList:
			if uTermDict['SAB']== 'HPO' and uTermDict['CODE'] in HPODataDict:
				AUI = uTermDict['AUI']
				code = uTermDict['CODE']
				ENG = uTermDict['STR']
				CNS = HPODataDict[code]['cns']
				assert AUI not in mapDict		#检查是否有多个AUI映射到同一个hpo
				mapDict[AUI] = ({'code': code, 'eng': ENG, 'cns': CNS})
		return mapDict
コード例 #5
0
	def getAUIMapDict(self):
		"""
		Returns:
			dict: {AUI: {'code': code, 'eng': ENG, 'cns': CNS)}
		"""
		MeSHDataDict = readMESH_CNSCHISC(
			DATA_PATH+'/thesaurus/cn/MeSH/chisc/Mesh-医学主题词表.txt',
			DATA_PATH+'/thesaurus/en/NLM/ascii/d2017.bin'
		)
		UMLSDataList = readUMLS_ENG(DATA_PATH+'/umlsMT/umls/MRCONSO.RRF')
		mapDict = {}
		for uTermDict in UMLSDataList:
			if uTermDict['SAB']== 'MSH' and uTermDict['CODE'] in MeSHDataDict:
				AUI = uTermDict['AUI']
				code = uTermDict['CODE']
				ENG = uTermDict['STR']
				CNS = MeSHDataDict[code]
				assert AUI not in mapDict		#检查是否有多个AUI映射到同一个hpo
				mapDict[AUI] = ({'code': code, 'eng': ENG, 'cns': CNS})
		return mapDict
コード例 #6
0
    def getAUIMapDict(self):
        """
		Returns:
			dict: {AUI: {'code': code, 'eng': ENG, 'cns': CNS)}
		"""
        termCNSICIBA = json.load(
            open(DATA_PATH + '/umlsMT/translate/termCNSICIBA.json'))
        AUI = json.load(open(DATA_PATH + '/umlsMT/translate/AUI.json'))
        UMLSDataList = readUMLS_ENG(DATA_PATH + '/umlsMT/umls/MRCONSO.RRF')
        getContentFunc = self.getUsefulContent  # getFullContent

        UMLSDataDict = {termDict['AUI']: termDict for termDict in UMLSDataList}
        mapDict = {}
        for i in range(len(termCNSICIBA)):
            CNS = getContentFunc(termCNSICIBA[i])
            if CNS:
                for aui in AUI[i]:
                    code = UMLSDataDict[aui]['CODE']
                    ENG = UMLSDataDict[aui]['STR']
                    mapDict[aui] = {'code': code, 'eng': ENG, 'cns': CNS}
        return mapDict