diff --git a/examples/pipelines/data_configs/data_config_test.jsonl b/examples/pipelines/data_configs/data_config_test.jsonl index 4c8fa33..06d8977 100644 --- a/examples/pipelines/data_configs/data_config_test.jsonl +++ b/examples/pipelines/data_configs/data_config_test.jsonl @@ -1 +1,83 @@ -{"bootcamp_name": "SymbolicRegression", "sample_number": 100, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"} \ No newline at end of file +{"bootcamp_name": "SymbolicRegression", "sample_number": 100, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"} +{"bootcamp_name": "cipher", "sample_number": 3, "config_file": "cipher", "bootcamp_cls_name": "Cipherbootcamp"} +{"bootcamp_name": "korLogicDefinitions", "sample_number": 64, "config_file": "korLogicDefinitions", "bootcamp_cls_name": "KorLogicDefinitionsbootcamp"} +{"bootcamp_name": "korLogicCooperativePrinciple", "sample_number": 64, "config_file": "korLogicCooperativePrinciple", "bootcamp_cls_name": "KorLogicCooperativePrinciplebootcamp"} +{"bootcamp_name": "korOperationUnicodeffe0", "sample_number": 64, "config_file": "korOperationUnicodeffe0", "bootcamp_cls_name": "KorOperationUnicodeffe0bootcamp"} +{"bootcamp_name": "korLogicEpistemicLogic", "sample_number": 64, "config_file": "korLogicEpistemicLogic", "bootcamp_cls_name": "KorLogicEpistemicLogicbootcamp"} +{"bootcamp_name": "korLogicDerivativeReasoningOfPropositionalLogic", "sample_number": 64, "config_file": "korLogicDerivativeReasoningOfPropositionalLogic", "bootcamp_cls_name": "KorLogicDerivativeReasoningOfPropositionalLogicbootcamp"} +{"bootcamp_name": "korLogicTruthValueModalPropositions", "sample_number": 64, "config_file": "korLogicTruthValueModalPropositions", "bootcamp_cls_name": "KorLogicTruthValueModalPropositionsbootcamp"} +{"bootcamp_name": "BBEHBuggyTables", "sample_number": 64, "config_file": "BBEHBuggyTables", "bootcamp_cls_name": "BBEHBuggyTablesbootcamp"} +{"bootcamp_name": "BbehWordSorting", "sample_number": 64, "config_file": "BbehWordSorting", "bootcamp_cls_name": "BbehWordSortingbootcamp"} +{"bootcamp_name": "korLogicFigureOfTheSyllogism", "sample_number": 64, "config_file": "korLogicFigureOfTheSyllogism", "bootcamp_cls_name": "KorLogicFigureOfTheSyllogismbootcamp"} +{"bootcamp_name": "korLogicResolution", "sample_number": 64, "config_file": "korLogicResolution", "bootcamp_cls_name": "KorLogicResolutionbootcamp"} +{"bootcamp_name": "thermometers", "sample_number": 64, "config_file": "thermometers", "bootcamp_cls_name": "Thermometersbootcamp"} +{"bootcamp_name": "korPuzzleCalcudoko", "sample_number": 64, "config_file": "korPuzzleCalcudoko", "bootcamp_cls_name": "KorPuzzleCalcudokobootcamp"} +{"bootcamp_name": "korPuzzle24Points", "sample_number": 64, "config_file": "korPuzzle24Points", "bootcamp_cls_name": "KorPuzzle24Pointsbootcamp"} +{"bootcamp_name": "korOperationUnicode2295", "sample_number": 64, "config_file": "korOperationUnicode2295", "bootcamp_cls_name": "KorOperationUnicode2295bootcamp"} +{"bootcamp_name": "nonograms", "sample_number": 64, "config_file": "nonograms", "bootcamp_cls_name": "Nonogramsbootcamp"} +{"bootcamp_name": "bbehboardgameqa", "sample_number": 64, "config_file": "bbeh_boardgame_qa", "bootcamp_cls_name": "Bbehboardgameqabootcamp"} +{"bootcamp_name": "korLogicEquivalenceCalculus", "sample_number": 64, "config_file": "korLogicEquivalenceCalculus", "bootcamp_cls_name": "KorLogicEquivalenceCalculusbootcamp"} +{"bootcamp_name": "dominosa", "sample_number": 64, "config_file": "dominosa", "bootcamp_cls_name": "Dominosabootcamp"} +{"bootcamp_name": "korPuzzleCryptoMath", "sample_number": 64, "config_file": "korPuzzleCryptoMath", "bootcamp_cls_name": "KorPuzzleCryptoMathbootcamp"} +{"bootcamp_name": "korLogicAnalogicalReasoning", "sample_number": 64, "config_file": "korLogicAnalogicalReasoning", "bootcamp_cls_name": "KorLogicAnalogicalReasoningbootcamp"} +{"bootcamp_name": "korOperationUnicode25bd", "sample_number": 64, "config_file": "korOperationUnicode25bd", "bootcamp_cls_name": "KorOperationUnicode25bdbootcamp"} +{"bootcamp_name": "korPuzzleWordBrainTeasers", "sample_number": 64, "config_file": "korPuzzleWordBrainTeasers", "bootcamp_cls_name": "KorPuzzleWordBrainTeasersbootcamp"} +{"bootcamp_name": "korOperationUnicode25a1", "sample_number": 64, "config_file": "korOperationUnicode25a1", "bootcamp_cls_name": "KorOperationUnicode25a1bootcamp"} +{"bootcamp_name": "kakurasu", "sample_number": 64, "config_file": "kakurasu", "bootcamp_cls_name": "Kakurasubootcamp"} +{"bootcamp_name": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "sample_number": 64, "config_file": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "bootcamp_cls_name": "KorLogicLogicalMethodsForExploringCauseAndEffectRelationshipsbootcamp"} +{"bootcamp_name": "binairo", "sample_number": 64, "config_file": "binairo", "bootcamp_cls_name": "Binairobootcamp"} +{"bootcamp_name": "korLogicInductionParadox", "sample_number": 64, "config_file": "korLogicInductionParadox", "bootcamp_cls_name": "KorLogicInductionParadoxbootcamp"} +{"bootcamp_name": "galaxies", "sample_number": 64, "config_file": "galaxies", "bootcamp_cls_name": "Galaxiesbootcamp"} +{"bootcamp_name": "BbehMultistepArithmetic", "sample_number": 64, "config_file": "BbehMultistepArithmetic", "bootcamp_cls_name": "BbehMultistepArithmeticbootcamp"} +{"bootcamp_name": "korLogicPropositionalLogicFormalization", "sample_number": 64, "config_file": "korLogicPropositionalLogicFormalization", "bootcamp_cls_name": "KorLogicPropositionalLogicFormalizationbootcamp"} +{"bootcamp_name": "korOperationUnicode25cb", "sample_number": 64, "config_file": "korOperationUnicode25cb", "bootcamp_cls_name": "KorOperationUnicode25cbbootcamp"} +{"bootcamp_name": "LightUp", "sample_number": 64, "config_file": "Light_Up", "bootcamp_cls_name": "LightUpbootcamp"} +{"bootcamp_name": "starbattle", "sample_number": 64, "config_file": "starbattle", "bootcamp_cls_name": "Starbattlebootcamp"} +{"bootcamp_name": "korOperationUnicode25b3", "sample_number": 64, "config_file": "korOperationUnicode25b3", "bootcamp_cls_name": "KorOperationUnicode25b3bootcamp"} +{"bootcamp_name": "sudoku", "sample_number": 64, "config_file": "sudoku", "bootcamp_cls_name": "Sudokubootcamp"} +{"bootcamp_name": "korLogicSpeechActs", "sample_number": 64, "config_file": "korLogicSpeechActs", "bootcamp_cls_name": "KorLogicSpeechActsbootcamp"} +{"bootcamp_name": "korOperationUnicode25a0", "sample_number": 64, "config_file": "korOperationUnicode25a0", "bootcamp_cls_name": "KorOperationUnicode25a0bootcamp"} +{"bootcamp_name": "korLogicStatisticalReasoning", "sample_number": 64, "config_file": "korLogicStatisticalReasoning", "bootcamp_cls_name": "KorLogicStatisticalReasoningbootcamp"} +{"bootcamp_name": "aquarium", "sample_number": 64, "config_file": "aquarium", "bootcamp_cls_name": "Aquariumbootcamp"} +{"bootcamp_name": "korLogicEnumerativeInductiveReasoning", "sample_number": 64, "config_file": "korLogicEnumerativeInductiveReasoning", "bootcamp_cls_name": "KorLogicEnumerativeInductiveReasoningbootcamp"} +{"bootcamp_name": "minesweeper", "sample_number": 64, "config_file": "minesweeper", "bootcamp_cls_name": "Minesweeperbootcamp"} +{"bootcamp_name": "futoshiki", "sample_number": 64, "config_file": "futoshiki", "bootcamp_cls_name": "Futoshikibootcamp"} +{"bootcamp_name": "BbehWebOfLies", "sample_number": 64, "config_file": "BbehWebOfLies", "bootcamp_cls_name": "BbehWebOfLiesbootcamp"} +{"bootcamp_name": "korOperationUnicode2605", "sample_number": 64, "config_file": "korOperationUnicode2605", "bootcamp_cls_name": "KorOperationUnicode2605bootcamp"} +{"bootcamp_name": "korPuzzleLogicPuzzle", "sample_number": 64, "config_file": "korPuzzleLogicPuzzle", "bootcamp_cls_name": "KorPuzzleLogicPuzzlebootcamp"} +{"bootcamp_name": "BbehGeometricShapes", "sample_number": 64, "config_file": "BbehGeometricShapes", "bootcamp_cls_name": "BbehGeometricShapesbootcamp"} +{"bootcamp_name": "korPuzzleWordRootsAndAffixes", "sample_number": 64, "config_file": "korPuzzleWordRootsAndAffixes", "bootcamp_cls_name": "KorPuzzleWordRootsAndAffixesbootcamp"} +{"bootcamp_name": "korPuzzleSkyscrapers", "sample_number": 64, "config_file": "korPuzzleSkyscrapers", "bootcamp_cls_name": "KorPuzzleSkyscrapersbootcamp"} +{"bootcamp_name": "korOperationUnicode25cf", "sample_number": 64, "config_file": "korOperationUnicode25cf", "bootcamp_cls_name": "KorOperationUnicode25cfbootcamp"} +{"bootcamp_name": "korLogicPredicateLogicFormalization", "sample_number": 64, "config_file": "korLogicPredicateLogicFormalization", "bootcamp_cls_name": "KorLogicPredicateLogicFormalizationbootcamp"} +{"bootcamp_name": "korPuzzleArrowMaze", "sample_number": 64, "config_file": "korPuzzleArrowMaze", "bootcamp_cls_name": "KorPuzzleArrowMazebootcamp"} +{"bootcamp_name": "bbehshuffobject", "sample_number": 64, "config_file": "bbeh_shuff_object", "bootcamp_cls_name": "Bbehshuffobjectbootcamp"} +{"bootcamp_name": "korPuzzleKukurasu", "sample_number": 64, "config_file": "korPuzzleKukurasu", "bootcamp_cls_name": "KorPuzzleKukurasubootcamp"} +{"bootcamp_name": "korLogicDynamicLogic", "sample_number": 64, "config_file": "korLogicDynamicLogic", "bootcamp_cls_name": "KorLogicDynamicLogicbootcamp"} +{"bootcamp_name": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "sample_number": 64, "config_file": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "bootcamp_cls_name": "KorLogicDisjunctiveNormalFormAndConjunctiveNormalFormbootcamp"} +{"bootcamp_name": "korPuzzleWordscapes", "sample_number": 64, "config_file": "korPuzzleWordscapes", "bootcamp_cls_name": "KorPuzzleWordscapesbootcamp"} +{"bootcamp_name": "bbehobjectproperties", "sample_number": 64, "config_file": "bbeh_object_properties", "bootcamp_cls_name": "Bbehobjectpropertiesbootcamp"} +{"bootcamp_name": "stitches", "sample_number": 64, "config_file": "stitches", "bootcamp_cls_name": "Stitchesbootcamp"} +{"bootcamp_name": "korPuzzleWordLadder", "sample_number": 64, "config_file": "korPuzzleWordLadder", "bootcamp_cls_name": "KorPuzzleWordLadderbootcamp"} +{"bootcamp_name": "BbehDyckLanguages", "sample_number": 64, "config_file": "BbehDyckLanguages", "bootcamp_cls_name": "BbehDyckLanguagesbootcamp"} +{"bootcamp_name": "calcudoku", "sample_number": 64, "config_file": "calcudoku", "bootcamp_cls_name": "Calcudokubootcamp"} +{"bootcamp_name": "korOperationUnicodeffe1", "sample_number": 64, "config_file": "korOperationUnicodeffe1", "bootcamp_cls_name": "KorOperationUnicodeffe1bootcamp"} +{"bootcamp_name": "korPuzzleCampsite", "sample_number": 64, "config_file": "korPuzzleCampsite", "bootcamp_cls_name": "KorPuzzleCampsitebootcamp"} +{"bootcamp_name": "korOperationUnicode20ac", "sample_number": 64, "config_file": "korOperationUnicode20ac", "bootcamp_cls_name": "KorOperationUnicode20acbootcamp"} +{"bootcamp_name": "korLogicPropositionalLogicConcepts", "sample_number": 64, "config_file": "korLogicPropositionalLogicConcepts", "bootcamp_cls_name": "KorLogicPropositionalLogicConceptsbootcamp"} +{"bootcamp_name": "arc", "sample_number": 64, "config_file": "arc", "bootcamp_cls_name": "Arcbootcamp"} +{"bootcamp_name": "korPuzzleWordSearch", "sample_number": 64, "config_file": "korPuzzleWordSearch", "bootcamp_cls_name": "KorPuzzleWordSearchbootcamp"} +{"bootcamp_name": "cryptomath", "sample_number": 64, "config_file": "crypto_math", "bootcamp_cls_name": "Cryptomathbootcamp"} +{"bootcamp_name": "arrowmaze", "sample_number": 64, "config_file": "arrowmaze", "bootcamp_cls_name": "Arrowmazebootcamp"} +{"bootcamp_name": "korLogicTemporalPropositions", "sample_number": 64, "config_file": "korLogicTemporalPropositions", "bootcamp_cls_name": "KorLogicTemporalPropositionsbootcamp"} +{"bootcamp_name": "bbehbooleanexpressions", "sample_number": 64, "config_file": "bbeh_boolean_expressions", "bootcamp_cls_name": "Bbehbooleanexpressionsbootcamp"} +{"bootcamp_name": "tents", "sample_number": 64, "config_file": "tents", "bootcamp_cls_name": "Tentsbootcamp"} +{"bootcamp_name": "bbehobjectcounting", "sample_number": 64, "config_file": "bbeh_object_counting", "bootcamp_cls_name": "Bbehobjectcountingbootcamp"} +{"bootcamp_name": "game24", "sample_number": 64, "config_file": "game24", "bootcamp_cls_name": "Game24bootcamp"} +{"bootcamp_name": "maze", "sample_number": 64, "config_file": "maze", "bootcamp_cls_name": "Mazebootcamp"} +{"bootcamp_name": "korOperationUnicode25ce", "sample_number": 64, "config_file": "korOperationUnicode25ce", "bootcamp_cls_name": "KorOperationUnicode25cebootcamp"} +{"bootcamp_name": "campsite", "sample_number": 64, "config_file": "campsite", "bootcamp_cls_name": "Campsitebootcamp"} +{"bootcamp_name": "korLogicCanonicalPropositions", "sample_number": 64, "config_file": "korLogicCanonicalPropositions", "bootcamp_cls_name": "KorLogicCanonicalPropositionsbootcamp"} +{"bootcamp_name": "korPuzzleConnectWords", "sample_number": 64, "config_file": "korPuzzleConnectWords", "bootcamp_cls_name": "KorPuzzleConnectWordsbootcamp"} +{"bootcamp_name": "korLogicFormalFallacies", "sample_number": 64, "config_file": "korLogicFormalFallacies", "bootcamp_cls_name": "KorLogicFormalFallaciesbootcamp"} +{"bootcamp_name": "BBEHHyperbaton", "sample_number": 64, "config_file": "BBEHHyperbaton", "bootcamp_cls_name": "BBEHHyperbatonbootcamp"} diff --git a/examples/pipelines/data_configs/data_config_train.jsonl b/examples/pipelines/data_configs/data_config_train.jsonl index 27fdb6e..f438374 100644 --- a/examples/pipelines/data_configs/data_config_train.jsonl +++ b/examples/pipelines/data_configs/data_config_train.jsonl @@ -1 +1,83 @@ -{"bootcamp_name": "SymbolicRegression", "sample_number": 30000, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"} \ No newline at end of file +{"bootcamp_name": "SymbolicRegression", "sample_number": 30000, "config_file": "Symbolic_Regression", "bootcamp_cls_name": "SymbolicRegressionbootcamp"} +{"bootcamp_name": "cipher", "sample_number": 200, "config_file": "cipher", "bootcamp_cls_name": "Cipherbootcamp"} +{"bootcamp_name": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "sample_number": 1000, "config_file": "korLogicDisjunctiveNormalFormAndConjunctiveNormalForm", "bootcamp_cls_name": "KorLogicDisjunctiveNormalFormAndConjunctiveNormalFormbootcamp"} +{"bootcamp_name": "korLogicFigureOfTheSyllogism", "sample_number": 1000, "config_file": "korLogicFigureOfTheSyllogism", "bootcamp_cls_name": "KorLogicFigureOfTheSyllogismbootcamp"} +{"bootcamp_name": "korPuzzle24Points", "sample_number": 1000, "config_file": "korPuzzle24Points", "bootcamp_cls_name": "KorPuzzle24Pointsbootcamp"} +{"bootcamp_name": "stitches", "sample_number": 2000, "config_file": "stitches", "bootcamp_cls_name": "Stitchesbootcamp"} +{"bootcamp_name": "bbehobjectproperties", "sample_number": 2000, "config_file": "bbeh_object_properties", "bootcamp_cls_name": "Bbehobjectpropertiesbootcamp"} +{"bootcamp_name": "thermometers", "sample_number": 2000, "config_file": "thermometers", "bootcamp_cls_name": "Thermometersbootcamp"} +{"bootcamp_name": "BBEHBuggyTables", "sample_number": 2000, "config_file": "BBEHBuggyTables", "bootcamp_cls_name": "BBEHBuggyTablesbootcamp"} +{"bootcamp_name": "korLogicDynamicLogic", "sample_number": 1000, "config_file": "korLogicDynamicLogic", "bootcamp_cls_name": "KorLogicDynamicLogicbootcamp"} +{"bootcamp_name": "futoshiki", "sample_number": 2000, "config_file": "futoshiki", "bootcamp_cls_name": "Futoshikibootcamp"} +{"bootcamp_name": "korLogicStatisticalReasoning", "sample_number": 1000, "config_file": "korLogicStatisticalReasoning", "bootcamp_cls_name": "KorLogicStatisticalReasoningbootcamp"} +{"bootcamp_name": "nonograms", "sample_number": 2000, "config_file": "nonograms", "bootcamp_cls_name": "Nonogramsbootcamp"} +{"bootcamp_name": "bbehboardgameqa", "sample_number": 2000, "config_file": "bbeh_boardgame_qa", "bootcamp_cls_name": "Bbehboardgameqabootcamp"} +{"bootcamp_name": "korPuzzleWordscapes", "sample_number": 1000, "config_file": "korPuzzleWordscapes", "bootcamp_cls_name": "KorPuzzleWordscapesbootcamp"} +{"bootcamp_name": "BbehDyckLanguages", "sample_number": 2000, "config_file": "BbehDyckLanguages", "bootcamp_cls_name": "BbehDyckLanguagesbootcamp"} +{"bootcamp_name": "korOperationUnicode2605", "sample_number": 1000, "config_file": "korOperationUnicode2605", "bootcamp_cls_name": "KorOperationUnicode2605bootcamp"} +{"bootcamp_name": "korLogicResolution", "sample_number": 1000, "config_file": "korLogicResolution", "bootcamp_cls_name": "KorLogicResolutionbootcamp"} +{"bootcamp_name": "korPuzzleCryptoMath", "sample_number": 1000, "config_file": "korPuzzleCryptoMath", "bootcamp_cls_name": "KorPuzzleCryptoMathbootcamp"} +{"bootcamp_name": "korPuzzleWordRootsAndAffixes", "sample_number": 1000, "config_file": "korPuzzleWordRootsAndAffixes", "bootcamp_cls_name": "KorPuzzleWordRootsAndAffixesbootcamp"} +{"bootcamp_name": "korPuzzleSkyscrapers", "sample_number": 1000, "config_file": "korPuzzleSkyscrapers", "bootcamp_cls_name": "KorPuzzleSkyscrapersbootcamp"} +{"bootcamp_name": "cryptomath", "sample_number": 2000, "config_file": "crypto_math", "bootcamp_cls_name": "Cryptomathbootcamp"} +{"bootcamp_name": "korLogicCanonicalPropositions", "sample_number": 1000, "config_file": "korLogicCanonicalPropositions", "bootcamp_cls_name": "KorLogicCanonicalPropositionsbootcamp"} +{"bootcamp_name": "korOperationUnicodeffe0", "sample_number": 1000, "config_file": "korOperationUnicodeffe0", "bootcamp_cls_name": "KorOperationUnicodeffe0bootcamp"} +{"bootcamp_name": "BbehWebOfLies", "sample_number": 1000, "config_file": "BbehWebOfLies", "bootcamp_cls_name": "BbehWebOfLiesbootcamp"} +{"bootcamp_name": "korLogicPropositionalLogicFormalization", "sample_number": 1000, "config_file": "korLogicPropositionalLogicFormalization", "bootcamp_cls_name": "KorLogicPropositionalLogicFormalizationbootcamp"} +{"bootcamp_name": "korLogicDefinitions", "sample_number": 1000, "config_file": "korLogicDefinitions", "bootcamp_cls_name": "KorLogicDefinitionsbootcamp"} +{"bootcamp_name": "minesweeper", "sample_number": 2000, "config_file": "minesweeper", "bootcamp_cls_name": "Minesweeperbootcamp"} +{"bootcamp_name": "BbehWordSorting", "sample_number": 800, "config_file": "BbehWordSorting", "bootcamp_cls_name": "BbehWordSortingbootcamp"} +{"bootcamp_name": "korLogicDerivativeReasoningOfPropositionalLogic", "sample_number": 1000, "config_file": "korLogicDerivativeReasoningOfPropositionalLogic", "bootcamp_cls_name": "KorLogicDerivativeReasoningOfPropositionalLogicbootcamp"} +{"bootcamp_name": "korOperationUnicode2295", "sample_number": 1000, "config_file": "korOperationUnicode2295", "bootcamp_cls_name": "KorOperationUnicode2295bootcamp"} +{"bootcamp_name": "bbehbooleanexpressions", "sample_number": 2000, "config_file": "bbeh_boolean_expressions", "bootcamp_cls_name": "Bbehbooleanexpressionsbootcamp"} +{"bootcamp_name": "starbattle", "sample_number": 2000, "config_file": "starbattle", "bootcamp_cls_name": "Starbattlebootcamp"} +{"bootcamp_name": "bbehobjectcounting", "sample_number": 2000, "config_file": "bbeh_object_counting", "bootcamp_cls_name": "Bbehobjectcountingbootcamp"} +{"bootcamp_name": "arrowmaze", "sample_number": 2000, "config_file": "arrowmaze", "bootcamp_cls_name": "Arrowmazebootcamp"} +{"bootcamp_name": "korPuzzleLogicPuzzle", "sample_number": 1000, "config_file": "korPuzzleLogicPuzzle", "bootcamp_cls_name": "KorPuzzleLogicPuzzlebootcamp"} +{"bootcamp_name": "sudoku", "sample_number": 2000, "config_file": "sudoku", "bootcamp_cls_name": "Sudokubootcamp"} +{"bootcamp_name": "arc", "sample_number": 10000, "config_file": "arc", "bootcamp_cls_name": "Arcbootcamp"} +{"bootcamp_name": "korOperationUnicode25a1", "sample_number": 1000, "config_file": "korOperationUnicode25a1", "bootcamp_cls_name": "KorOperationUnicode25a1bootcamp"} +{"bootcamp_name": "bbehshuffobject", "sample_number": 1000, "config_file": "bbeh_shuff_object", "bootcamp_cls_name": "Bbehshuffobjectbootcamp"} +{"bootcamp_name": "game24", "sample_number": 8000, "config_file": "game24", "bootcamp_cls_name": "Game24bootcamp"} +{"bootcamp_name": "BbehGeometricShapes", "sample_number": 2000, "config_file": "BbehGeometricShapes", "bootcamp_cls_name": "BbehGeometricShapesbootcamp"} +{"bootcamp_name": "korPuzzleKukurasu", "sample_number": 1000, "config_file": "korPuzzleKukurasu", "bootcamp_cls_name": "KorPuzzleKukurasubootcamp"} +{"bootcamp_name": "korPuzzleWordSearch", "sample_number": 1000, "config_file": "korPuzzleWordSearch", "bootcamp_cls_name": "KorPuzzleWordSearchbootcamp"} +{"bootcamp_name": "korLogicCooperativePrinciple", "sample_number": 1000, "config_file": "korLogicCooperativePrinciple", "bootcamp_cls_name": "KorLogicCooperativePrinciplebootcamp"} +{"bootcamp_name": "korPuzzleCalcudoko", "sample_number": 1000, "config_file": "korPuzzleCalcudoko", "bootcamp_cls_name": "KorPuzzleCalcudokobootcamp"} +{"bootcamp_name": "BbehMultistepArithmetic", "sample_number": 2000, "config_file": "BbehMultistepArithmetic", "bootcamp_cls_name": "BbehMultistepArithmeticbootcamp"} +{"bootcamp_name": "korLogicSpeechActs", "sample_number": 1000, "config_file": "korLogicSpeechActs", "bootcamp_cls_name": "KorLogicSpeechActsbootcamp"} +{"bootcamp_name": "korPuzzleWordLadder", "sample_number": 1000, "config_file": "korPuzzleWordLadder", "bootcamp_cls_name": "KorPuzzleWordLadderbootcamp"} +{"bootcamp_name": "korPuzzleConnectWords", "sample_number": 1000, "config_file": "korPuzzleConnectWords", "bootcamp_cls_name": "KorPuzzleConnectWordsbootcamp"} +{"bootcamp_name": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "sample_number": 1000, "config_file": "korLogicLogicalMethodsForExploringCauseAndEffectRelationships", "bootcamp_cls_name": "KorLogicLogicalMethodsForExploringCauseAndEffectRelationshipsbootcamp"} +{"bootcamp_name": "korPuzzleArrowMaze", "sample_number": 1000, "config_file": "korPuzzleArrowMaze", "bootcamp_cls_name": "KorPuzzleArrowMazebootcamp"} +{"bootcamp_name": "korPuzzleWordBrainTeasers", "sample_number": 1000, "config_file": "korPuzzleWordBrainTeasers", "bootcamp_cls_name": "KorPuzzleWordBrainTeasersbootcamp"} +{"bootcamp_name": "LightUp", "sample_number": 2000, "config_file": "Light_Up", "bootcamp_cls_name": "LightUpbootcamp"} +{"bootcamp_name": "korOperationUnicode25bd", "sample_number": 1000, "config_file": "korOperationUnicode25bd", "bootcamp_cls_name": "KorOperationUnicode25bdbootcamp"} +{"bootcamp_name": "binairo", "sample_number": 2000, "config_file": "binairo", "bootcamp_cls_name": "Binairobootcamp"} +{"bootcamp_name": "korOperationUnicode25b3", "sample_number": 1000, "config_file": "korOperationUnicode25b3", "bootcamp_cls_name": "KorOperationUnicode25b3bootcamp"} +{"bootcamp_name": "korLogicFormalFallacies", "sample_number": 1000, "config_file": "korLogicFormalFallacies", "bootcamp_cls_name": "KorLogicFormalFallaciesbootcamp"} +{"bootcamp_name": "korOperationUnicode25cb", "sample_number": 1000, "config_file": "korOperationUnicode25cb", "bootcamp_cls_name": "KorOperationUnicode25cbbootcamp"} +{"bootcamp_name": "korOperationUnicodeffe1", "sample_number": 1000, "config_file": "korOperationUnicodeffe1", "bootcamp_cls_name": "KorOperationUnicodeffe1bootcamp"} +{"bootcamp_name": "korLogicTemporalPropositions", "sample_number": 1000, "config_file": "korLogicTemporalPropositions", "bootcamp_cls_name": "KorLogicTemporalPropositionsbootcamp"} +{"bootcamp_name": "korLogicEquivalenceCalculus", "sample_number": 1000, "config_file": "korLogicEquivalenceCalculus", "bootcamp_cls_name": "KorLogicEquivalenceCalculusbootcamp"} +{"bootcamp_name": "korLogicEpistemicLogic", "sample_number": 1000, "config_file": "korLogicEpistemicLogic", "bootcamp_cls_name": "KorLogicEpistemicLogicbootcamp"} +{"bootcamp_name": "maze", "sample_number": 2000, "config_file": "maze", "bootcamp_cls_name": "Mazebootcamp"} +{"bootcamp_name": "calcudoku", "sample_number": 2000, "config_file": "calcudoku", "bootcamp_cls_name": "Calcudokubootcamp"} +{"bootcamp_name": "aquarium", "sample_number": 2000, "config_file": "aquarium", "bootcamp_cls_name": "Aquariumbootcamp"} +{"bootcamp_name": "kakurasu", "sample_number": 2000, "config_file": "kakurasu", "bootcamp_cls_name": "Kakurasubootcamp"} +{"bootcamp_name": "korLogicTruthValueModalPropositions", "sample_number": 1000, "config_file": "korLogicTruthValueModalPropositions", "bootcamp_cls_name": "KorLogicTruthValueModalPropositionsbootcamp"} +{"bootcamp_name": "tents", "sample_number": 2000, "config_file": "tents", "bootcamp_cls_name": "Tentsbootcamp"} +{"bootcamp_name": "korLogicInductionParadox", "sample_number": 1000, "config_file": "korLogicInductionParadox", "bootcamp_cls_name": "KorLogicInductionParadoxbootcamp"} +{"bootcamp_name": "korPuzzleCampsite", "sample_number": 1000, "config_file": "korPuzzleCampsite", "bootcamp_cls_name": "KorPuzzleCampsitebootcamp"} +{"bootcamp_name": "korLogicAnalogicalReasoning", "sample_number": 1000, "config_file": "korLogicAnalogicalReasoning", "bootcamp_cls_name": "KorLogicAnalogicalReasoningbootcamp"} +{"bootcamp_name": "campsite", "sample_number": 2000, "config_file": "campsite", "bootcamp_cls_name": "Campsitebootcamp"} +{"bootcamp_name": "korOperationUnicode25ce", "sample_number": 1000, "config_file": "korOperationUnicode25ce", "bootcamp_cls_name": "KorOperationUnicode25cebootcamp"} +{"bootcamp_name": "dominosa", "sample_number": 2000, "config_file": "dominosa", "bootcamp_cls_name": "Dominosabootcamp"} +{"bootcamp_name": "korOperationUnicode20ac", "sample_number": 1000, "config_file": "korOperationUnicode20ac", "bootcamp_cls_name": "KorOperationUnicode20acbootcamp"} +{"bootcamp_name": "korLogicEnumerativeInductiveReasoning", "sample_number": 1000, "config_file": "korLogicEnumerativeInductiveReasoning", "bootcamp_cls_name": "KorLogicEnumerativeInductiveReasoningbootcamp"} +{"bootcamp_name": "korLogicPropositionalLogicConcepts", "sample_number": 1000, "config_file": "korLogicPropositionalLogicConcepts", "bootcamp_cls_name": "KorLogicPropositionalLogicConceptsbootcamp"} +{"bootcamp_name": "korOperationUnicode25cf", "sample_number": 1000, "config_file": "korOperationUnicode25cf", "bootcamp_cls_name": "KorOperationUnicode25cfbootcamp"} +{"bootcamp_name": "korLogicPredicateLogicFormalization", "sample_number": 1000, "config_file": "korLogicPredicateLogicFormalization", "bootcamp_cls_name": "KorLogicPredicateLogicFormalizationbootcamp"} +{"bootcamp_name": "galaxies", "sample_number": 2000, "config_file": "galaxies", "bootcamp_cls_name": "Galaxiesbootcamp"} +{"bootcamp_name": "korOperationUnicode25a0", "sample_number": 1000, "config_file": "korOperationUnicode25a0", "bootcamp_cls_name": "KorOperationUnicode25a0bootcamp"} +{"bootcamp_name": "BBEHHyperbaton", "sample_number": 1000, "config_file": "BBEHHyperbaton", "bootcamp_cls_name": "BBEHHyperbatonbootcamp"} diff --git a/examples/pipelines/puzzle_configs/InChI2logPbootcamp_test.json b/examples/pipelines/puzzle_configs/InChI2logPbootcamp_test.json new file mode 100644 index 0000000..a1dc24e --- /dev/null +++ b/examples/pipelines/puzzle_configs/InChI2logPbootcamp_test.json @@ -0,0 +1,6 @@ +[ + { + "max_atoms": 15, + "min_atoms": 3 + } +] \ No newline at end of file diff --git a/examples/pipelines/puzzle_configs/InChI2logPbootcamp_train.json b/examples/pipelines/puzzle_configs/InChI2logPbootcamp_train.json new file mode 100644 index 0000000..a1dc24e --- /dev/null +++ b/examples/pipelines/puzzle_configs/InChI2logPbootcamp_train.json @@ -0,0 +1,6 @@ +[ + { + "max_atoms": 15, + "min_atoms": 3 + } +] \ No newline at end of file diff --git a/examples/pipelines/puzzle_configs/SMILES2logPBootCamp_test.json b/examples/pipelines/puzzle_configs/SMILES2logPBootCamp_test.json new file mode 100644 index 0000000..7f31296 --- /dev/null +++ b/examples/pipelines/puzzle_configs/SMILES2logPBootCamp_test.json @@ -0,0 +1,6 @@ +[ + { + "min_len": 5, + "max_len": 25 + } +] \ No newline at end of file diff --git a/examples/pipelines/puzzle_configs/SMILES2logPBootCamp_train.json b/examples/pipelines/puzzle_configs/SMILES2logPBootCamp_train.json new file mode 100644 index 0000000..7f31296 --- /dev/null +++ b/examples/pipelines/puzzle_configs/SMILES2logPBootCamp_train.json @@ -0,0 +1,6 @@ +[ + { + "min_len": 5, + "max_len": 25 + } +] \ No newline at end of file diff --git a/examples/pipelines/puzzle_configs/earth_dew2humidity_test.json b/examples/pipelines/puzzle_configs/earth_dew2humidity_test.json new file mode 100644 index 0000000..04abb5b --- /dev/null +++ b/examples/pipelines/puzzle_configs/earth_dew2humidity_test.json @@ -0,0 +1,32 @@ +[ + { + "temperature_range": [ + -20, + 40 + ], + "temperature_dewpoint_range": [ + 0, + 10 + ] + }, + { + "temperature_range": [ + -15, + 35 + ], + "temperature_dewpoint_range": [ + 0, + 8 + ] + }, + { + "temperature_range": [ + -10, + 30 + ], + "temperature_dewpoint_range": [ + 0, + 5 + ] + } +] \ No newline at end of file diff --git a/examples/pipelines/puzzle_configs/earth_dew2humidity_train.json b/examples/pipelines/puzzle_configs/earth_dew2humidity_train.json new file mode 100644 index 0000000..62113f0 --- /dev/null +++ b/examples/pipelines/puzzle_configs/earth_dew2humidity_train.json @@ -0,0 +1,33 @@ +[ + { + "temperature_range": [ + -20, + 40 + ], + "temperature_dewpoint_range": [ + 0, + 10 + ] + }, + { + "temperature_range": [ + -15, + 35 + ], + "temperature_dewpoint_range": [ + 0, + 8 + ] + }, + { + "temperature_range": [ + -10, + 30 + ], + "temperature_dewpoint_range": [ + 0, + 5 + ] + } + ] + \ No newline at end of file diff --git a/examples/pipelines/puzzle_configs/linearODE_test.json b/examples/pipelines/puzzle_configs/linearODE_test.json new file mode 100644 index 0000000..2e3fc5f --- /dev/null +++ b/examples/pipelines/puzzle_configs/linearODE_test.json @@ -0,0 +1,77 @@ +[ + { + "k_range": [ + 0.15, + 0.9 + ], + "x0_range": [ + 0.6, + 1.8 + ], + "t_span": [ + 0, + 6 + ], + "n_points": 60 + }, + { + "k_range": [ + 0.3, + 2.0 + ], + "x0_range": [ + 0.7, + 3.0 + ], + "t_span": [ + 0, + 12 + ], + "n_points": 110 + }, + { + "k_range": [ + 0.05, + 0.4 + ], + "x0_range": [ + 0.2, + 1.3 + ], + "t_span": [ + 0, + 8 + ], + "n_points": 80 + }, + { + "k_range": [ + 0.25, + 1.2 + ], + "x0_range": [ + 0.4, + 2.2 + ], + "t_span": [ + 0, + 4 + ], + "n_points": 70 + }, + { + "k_range": [ + 0.2, + 1.1 + ], + "x0_range": [ + 0.3, + 2.5 + ], + "t_span": [ + 0, + 9 + ], + "n_points": 90 + } +] \ No newline at end of file diff --git a/examples/pipelines/puzzle_configs/linearODE_train.json b/examples/pipelines/puzzle_configs/linearODE_train.json new file mode 100644 index 0000000..57373b8 --- /dev/null +++ b/examples/pipelines/puzzle_configs/linearODE_train.json @@ -0,0 +1,152 @@ +[ + { + "k_range": [ + 0.1, + 1.0 + ], + "x0_range": [ + 0.5, + 2.0 + ], + "t_span": [ + 0, + 5 + ], + "n_points": 50 + }, + { + "k_range": [ + 0.2, + 1.5 + ], + "x0_range": [ + 0.3, + 2.5 + ], + "t_span": [ + 0, + 10 + ], + "n_points": 100 + }, + { + "k_range": [ + 0.05, + 0.5 + ], + "x0_range": [ + 0.4, + 1.5 + ], + "t_span": [ + 0, + 7 + ], + "n_points": 75 + }, + { + "k_range": [ + 0.1, + 0.8 + ], + "x0_range": [ + 0.6, + 2.0 + ], + "t_span": [ + 0, + 3 + ], + "n_points": 40 + }, + { + "k_range": [ + 0.3, + 1.2 + ], + "x0_range": [ + 0.5, + 3.0 + ], + "t_span": [ + 0, + 15 + ], + "n_points": 120 + }, + { + "k_range": [ + 0.2, + 0.8 + ], + "x0_range": [ + 0.7, + 2.5 + ], + "t_span": [ + 0, + 6 + ], + "n_points": 55 + }, + { + "k_range": [ + 0.5, + 1.8 + ], + "x0_range": [ + 0.4, + 3.0 + ], + "t_span": [ + 0, + 8 + ], + "n_points": 90 + }, + { + "k_range": [ + 0.1, + 0.6 + ], + "x0_range": [ + 0.3, + 1.8 + ], + "t_span": [ + 0, + 4 + ], + "n_points": 60 + }, + { + "k_range": [ + 0.15, + 1.0 + ], + "x0_range": [ + 0.5, + 2.3 + ], + "t_span": [ + 0, + 5 + ], + "n_points": 70 + }, + { + "k_range": [ + 0.3, + 1.5 + ], + "x0_range": [ + 0.6, + 2.8 + ], + "t_span": [ + 0, + 10 + ], + "n_points": 120 + } +] \ No newline at end of file diff --git a/internbootcamp/bootcamp/ChemStructure2Property/InChI2MRBootCamp.py b/internbootcamp/bootcamp/ChemStructure2Property/InChI2MRBootCamp.py new file mode 100755 index 0000000..5710aca --- /dev/null +++ b/internbootcamp/bootcamp/ChemStructure2Property/InChI2MRBootCamp.py @@ -0,0 +1,29 @@ +from rdkit import Chem +from rdkit.Chem import Crippen +from .InChI2logPBootCamp import InChI2logPbootcamp + +class InChI2MRBootCamp(InChI2logPbootcamp): + + def prompt_func(self, InChI) -> str: + + instruction = f"Given the InChI, determine the Molar Refractivity (MR) value of the material. The InChI is: {InChI}" + instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}".""" + + prompt = instruction + '\n' + instruction_following + return prompt + + @classmethod + def _verify_correction(cls, solution, InChI)->bool: + """ + Verify the correction of the solution. + """ + mol = Chem.MolFromInchi(InChI) + true_MR = Crippen.MolMR(mol) + solution_float = float(solution) + + # Handle case where true_logp is 0 + if true_MR == 0: + return abs(solution_float) <= 0.01 # Just check if solution is close to 0 + else: + return abs(true_MR - solution_float)/abs(true_MR) <= 0.01 + diff --git a/internbootcamp/bootcamp/ChemStructure2Property/InChI2logPBootCamp.py b/internbootcamp/bootcamp/ChemStructure2Property/InChI2logPBootCamp.py new file mode 100755 index 0000000..3e53750 --- /dev/null +++ b/internbootcamp/bootcamp/ChemStructure2Property/InChI2logPBootCamp.py @@ -0,0 +1,57 @@ +from internbootcamp.bootcamp.base import Basebootcamp +from internbootcamp.libs.chemStructure2Property.ChemStructureGenerator import InChIGenerator +from .utils import last_boxed_only_string, remove_boxed +from rdkit import Chem +from rdkit.Chem import Crippen + + +class InChI2logPbootcamp(Basebootcamp): + def __init__(self, max_atoms=15, min_atoms=3, elements=None, seed=None): + # super.__init__() + self.InChIGenerator = InChIGenerator(max_atoms=max_atoms, min_atoms=min_atoms, elements=elements, seed=seed) + self.tolerance_factor = tolerance_factor # 1 for 1% error consider true, 0.1 for 0.1% error true, 10 for 10% error + + def case_generator(self) -> str: + """ + 生成一组数字和目标值。 + """ + return self.InChIGenerator.generate_n_valid_inchi(1)[0] + + def prompt_func(self, InChI) -> str: + + instruction = f"Given the InChI, determine the lipophilicity (logP) value of the material. The InChI is: {InChI}" + instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}".""" + + prompt = instruction + '\n' + instruction_following + return prompt + + @staticmethod + def extract_output(output): + """ + Extract the output from the solution. + + Args: + output: Model output to be processed. + + Returns: + The processed output. + """ + output = last_boxed_only_string(output) + if output is None: + return None + return remove_boxed(output) + + @classmethod + def _verify_correction(cls, solution, InChI)->bool: + """ + Verify the correction of the solution. + """ + mol = Chem.MolFromInchi(InChI) + true_logp = Crippen.MolLogP(mol) + solution_float = float(solution) + + # Handle case where true_logp is 0 + if true_logp == 0: + return abs(solution_float) <= 0.01 # Just check if solution is close to 0 + else: + return abs(true_logp - solution_float)/abs(true_logp) <= 0.01 \ No newline at end of file diff --git a/internbootcamp/bootcamp/ChemStructure2Property/SMILES2MRBootCamp.py b/internbootcamp/bootcamp/ChemStructure2Property/SMILES2MRBootCamp.py new file mode 100755 index 0000000..a76d3f5 --- /dev/null +++ b/internbootcamp/bootcamp/ChemStructure2Property/SMILES2MRBootCamp.py @@ -0,0 +1,32 @@ +from internbootcamp.bootcamp.base import Basebootcamp +from internbootcamp.libs.chemStructure2Property.ChemStructureGenerator import SMILESGenerator +from .utils import last_boxed_only_string, remove_boxed +from rdkit import Chem +from rdkit.Chem import Crippen + +from .SMILES2logPBootCamp import SMILES2logPBootCamp + +class SMILES2MRBootCamp(SMILES2logPBootCamp): + + def prompt_func(self, SMILES) -> str: + + instruction = f"Given the SMILES, determine the Molar Refractivity (MR) value of the material. The SMILES is: {SMILES}" + instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}".""" + + prompt = instruction + '\n' + instruction_following + return prompt + + + @classmethod + def _verify_correction(cls, solution, SMILES)->bool: + """ + Verify the correction of the solution. + """ + mol = Chem.MolFromSmiles(SMILES) + true_MR = Crippen.MolMR(mol) + solution_float = float(solution) + if true_MR == 0: + return abs(solution_float) <= 0.01 # Just check if solution is close to 0 + else: + return abs(true_MR - solution_float)/abs(true_MR) <= 0.01 + \ No newline at end of file diff --git a/internbootcamp/bootcamp/ChemStructure2Property/SMILES2logPBootCamp.py b/internbootcamp/bootcamp/ChemStructure2Property/SMILES2logPBootCamp.py new file mode 100755 index 0000000..1bb1303 --- /dev/null +++ b/internbootcamp/bootcamp/ChemStructure2Property/SMILES2logPBootCamp.py @@ -0,0 +1,41 @@ +from internbootcamp.bootcamp.base import Basebootcamp +from internbootcamp.libs.chemStructure2Property.ChemStructureGenerator import SMILESGenerator +from .utils import last_boxed_only_string, remove_boxed +from rdkit import Chem +from rdkit.Chem import Crippen + +from .InChI2logPBootCamp import InChI2logPbootcamp + +class SMILES2logPBootCamp(InChI2logPbootcamp): + def __init__(self,min_len=5, max_len=25, + seed=None): + # super.__init__() + self.SMILESGenerator = SMILESGenerator(min_len=min_len, max_len=max_len, seed=seed) + + def case_generator(self) -> str: + """ + 生成一组数字和目标值。 + """ + return self.SMILESGenerator.generate_n_valid_smiles(1)[0] + + def prompt_func(self, SMILES) -> str: + + instruction = f"Given the SMILES, determine the lipophilicity (logP) value of the material. The SMILES is: {SMILES}" + instruction_following = """Let's think step by step and output the final answer within \\boxed{}.The final answer should be one float number. For example "Final Answer: \\boxed{afloat}".""" + + prompt = instruction + '\n' + instruction_following + return prompt + + + @classmethod + def _verify_correction(cls, solution, SMILES)->bool: + """ + Verify the correction of the solution. + """ + mol = Chem.MolFromSmiles(SMILES) + true_logp = Crippen.MolLogP(mol) + solution_float = float(solution) + if true_logp == 0: + return abs(solution_float) <= 0.01 # Just check if solution is close to 0 + else: + return abs(true_logp - solution_float)/abs(true_logp) <= 0.01 diff --git a/internbootcamp/bootcamp/ChemStructure2Property/utils.py b/internbootcamp/bootcamp/ChemStructure2Property/utils.py new file mode 100644 index 0000000..1d57203 --- /dev/null +++ b/internbootcamp/bootcamp/ChemStructure2Property/utils.py @@ -0,0 +1,43 @@ + +def remove_boxed(s): + if "\\boxed " in s: + left = "\\boxed " + assert s[:len(left)] == left + return s[len(left):] + + left = "\\boxed{" + + assert s[:len(left)] == left + assert s[-1] == "}" + + return s[len(left):-1] + + +def last_boxed_only_string(string): + idx = string.rfind("\\boxed") + if "\\boxed " in string: + return "\\boxed " + string.split("\\boxed ")[-1].split("$")[0] + if idx < 0: + idx = string.rfind("\\fbox") + if idx < 0: + return None + + i = idx + right_brace_idx = None + num_left_braces_open = 0 + while i < len(string): + if string[i] == "{": + num_left_braces_open += 1 + if string[i] == "}": + num_left_braces_open -= 1 + if num_left_braces_open == 0: + right_brace_idx = i + break + i += 1 + + if right_brace_idx is None: + retval = None + else: + retval = string[idx:right_brace_idx + 1] + + return retval \ No newline at end of file diff --git a/internbootcamp/bootcamp/__init__.py b/internbootcamp/bootcamp/__init__.py index 34e10e1..7a73937 100755 --- a/internbootcamp/bootcamp/__init__.py +++ b/internbootcamp/bootcamp/__init__.py @@ -30,6 +30,13 @@ from .bbeh_hyperbaton.hyperbaton_default import BBEHHyperbatonbootcamp from .bbeh_boardgame_qa.bbeh_boardgame_qa import Bbehboardgameqabootcamp from .bbeh_boolean_expressions.bbeh_boolean_expressions import Bbehbooleanexpressionsbootcamp + +from .ChemStructure2Property.InChI2logPBootCamp import InChI2logPbootcamp +from .ChemStructure2Property.InChI2MRBootCamp import InChI2MRBootCamp +from .ChemStructure2Property.SMILES2logPBootCamp import SMILES2logPBootCamp +from .ChemStructure2Property.SMILES2MRBootCamp import SMILES2MRBootCamp + + from .kakurasu.kakurasu import Kakurasubootcamp from .nonograms.nonograms import Nonogramsbootcamp from .hitori.hitori import Hitoribootcamp diff --git a/internbootcamp/bootcamp/earth_dew2humidity/earth_dew2humidity.py b/internbootcamp/bootcamp/earth_dew2humidity/earth_dew2humidity.py new file mode 100644 index 0000000..e07aadf --- /dev/null +++ b/internbootcamp/bootcamp/earth_dew2humidity/earth_dew2humidity.py @@ -0,0 +1,85 @@ +import re +import json +import numpy as np +from internbootcamp.bootcamp.base import Basebootcamp + + +class earth_dew2humidity(Basebootcamp): + def __init__( + self, + temperature_range=(-20, 40), + temperature_dewpoint_range=(0, 10), + seed=None + ): + self.temperature_range, self.temperature_dewpoint_range = temperature_range, temperature_dewpoint_range + if seed is not None: + np.random.seed(seed) + + def case_generator(self): + # 1. 随机采样参数 dewpoint 和 temperature + temperature_original = float(np.random.uniform(*self.temperature_range)) + dewpoint_original = temperature_original - float(np.random.uniform(*self.temperature_dewpoint_range)) + # 2. 计算湿度 + dewpoint = dewpoint_original + 273.15 + temperature = temperature_original + 273.15 + e = 611.2 * np.exp(17.67 * (dewpoint - 273.15) / (dewpoint - 29.65)) + e_s = 611.2 * np.exp(17.67 * (temperature - 273.15) / (temperature - 29.65)) + rh = e / e_s * 100 + return {"dewpoint": dewpoint_original, "temperature": temperature_original, "humidity": float(rh)} + + def prompt_func(self, identity) -> str: + dewpoint = identity["dewpoint"] + temperature = identity["temperature"] + return ( + f"下面给出露点温度(dewpoint)={dewpoint} (摄氏度)\n温度(temperature)={temperature} (摄氏度)\n" + "请计算湿度,计算公式为:\n" + "dewpoint = dewpoint + 273.15,temperature = temperature + 273.15\n" + "e = 611.2 * np.exp(17.67 * (dewpoint - 273.15) / (dewpoint - 29.65))\n" + "e_s = 611.2 * np.exp(17.67 * (temperature - 273.15) / (temperature - 29.65))\n" + "relative humidity = e / e_s * 100\n" + "只需返回 “relative humidity = ”。" + ) + + @staticmethod + def extract_output(output: str) -> str: + # 用正则提取“relative humidity = …”右侧的表达式 + m = re.search(r"relative humidity\s*=\s*([^\n\r]+)", output) + return m.group(1).strip() if m else None + + @classmethod + def _verify_correction(cls, solution: str, identity: dict) -> bool: + # 解析 LLM 给出的系数 c,形如 “c*x” + solution = solution.replace(" ", "") + try: + c = float(solution) + except: + return False + # print(c) + # 验证 c ≈ k + return abs(c - identity["humidity"]) < 1e-2 + + +if __name__ == "__main__": + bootcamp = earth_dew2humidity(seed=123) + # 生成几个样例 + examples = [bootcamp.case_generator() for _ in range(3)] + print(examples) + print(bootcamp.prompt_func(examples[0])) + print(bootcamp.extract_output("xxxxx relative humidity = 111222 ")) + solution = bootcamp.extract_output("xxxxx relative humidity = 84.79 ") + print(bootcamp._verify_correction(solution, examples[0])) + solution = bootcamp.extract_output("xxxxx relative humidity = 83.79 ") + print(bootcamp._verify_correction(solution, examples[0])) + + for identity in examples: + # 构造“模型”返回答案,模拟 LLM 的输出 + humidity = identity["humidity"] + sol = f"{humidity:.4f}" + # 调用 Basebootcamp 提供的 verify_score 接口进行验证 + score = bootcamp.verify_score(sol, identity, short_threshold=1e-2) + # 打印结果 + print(json.dumps({ + "identity": identity, + "solution": sol, + "verify_score": score + }, ensure_ascii=False, indent=2)) \ No newline at end of file diff --git a/internbootcamp/bootcamp/linearODE/linearODE.py b/internbootcamp/bootcamp/linearODE/linearODE.py new file mode 100644 index 0000000..4afff31 --- /dev/null +++ b/internbootcamp/bootcamp/linearODE/linearODE.py @@ -0,0 +1,78 @@ +import re +import json +import numpy as np +from scipy.integrate import odeint +from internbootcamp.bootcamp.base import Basebootcamp + + +class LinearODEBootcamp(Basebootcamp): + def __init__( + self, + k_range=(0.1, 1.0), + x0_range=(0.5, 2.0), + t_span=(0, 5), + n_points=50, + seed=None + ): + self.k_range, self.x0_range = k_range, x0_range + self.t0, self.t1 = t_span + self.n_points = n_points + if seed is not None: + np.random.seed(seed) + + def case_generator(self): + # 1. 随机采样参数 k 和初始值 x0 + k = float(np.random.uniform(*self.k_range)) + x0 = float(np.random.uniform(*self.x0_range)) + # 2. 构造时间序列并模拟 dx/dt = -k * x + t = np.linspace(self.t0, self.t1, self.n_points).tolist() + def model(x, t_val): + return -k * x + x = odeint(model, x0, t).flatten().tolist() + return {"t": t, "x": x, "k": k} + + def prompt_func(self, identity) -> str: + # 将 (t, x) 对格式化为提示 + points = ", ".join(f"({t:.2f}, {x:.2f})" + for t, x in zip(identity["t"], identity["x"])) + return ( + f"下面给出变量 x(t) 的观测数据点:\n{points}\n\n" + "请找出其满足的微分方程,形式为:dx/dt = f(x)。\n" + "只需返回 “dx/dt = <表达式>”。" + ) + + @staticmethod + def extract_output(output: str) -> str: + # 用正则提取“dx/dt = …”右侧的表达式 + m = re.search(r"dx/dt\s*=\s*([^\n\r]+)", output) + return m.group(1).strip() if m else None + + @classmethod + def _verify_correction(cls, solution: str, identity: dict) -> bool: + # 解析 LLM 给出的系数 c,形如 “c*x” + sol = solution.replace(" ", "") + match = re.fullmatch(r"([\-0-9\.eE]+)\*x", sol) + if not match: + return False + c = float(match.group(1)) + # 验证 c ≈ -k + return abs(c + identity["k"]) < 1e-2 + + +if __name__ == "__main__": + bootcamp = LinearODEBootcamp(seed=123) + # 生成几个样例 + examples = [bootcamp.case_generator() for _ in range(3)] + + for identity in examples: + # 构造“模型”返回答案,模拟 LLM 的输出 + coeff = -identity["k"] + sol = f"{coeff:.4f}*x" + # 调用 Basebootcamp 提供的 verify_score 接口进行验证 + score = bootcamp.verify_score(sol, identity, short_threshold=1e-2) + # 打印结果 + print(json.dumps({ + "identity": identity, + "solution": sol, + "verify_score": score + }, ensure_ascii=False, indent=2)) \ No newline at end of file diff --git a/internbootcamp/bootcamp/med_calculator/med_calculator.json b/internbootcamp/bootcamp/med_calculator/med_calculator.json new file mode 100644 index 0000000..7c271bc --- /dev/null +++ b/internbootcamp/bootcamp/med_calculator/med_calculator.json @@ -0,0 +1,4755 @@ +{ + "equation": { + "QT间期校正(EKG)—RR间期": { + "id": 299, + "category": "内分泌及代谢紊乱", + "name": "QT间期校正(EKG)—RR间期", + "formula": "60 / 心率", + "inputs": [ + "心率" + ], + "remarks": "" + }, + "QT间期校正(EKG)—校正QT间期": { + "id": 300, + "category": "内分泌及代谢紊乱", + "name": "QT间期校正(EKG)—校正QT间期", + "formula": "QT间期 / math.sqrt( 60 / 心率)", + "inputs": [ + "QT间期", + "心率" + ], + "remarks": "" + }, + "男孩(2-20岁)的体质量指数百分比—身体质量指数": { + "id": 7, + "category": "儿科学", + "name": "男孩(2-20岁)的体质量指数百分比—身体质量指数", + "formula": "体重/(身高/100)**2", + "inputs": [ + "身高", + "体重" + ], + "remarks": "" + }, + "女孩(2-20岁)的体质量指数百分比—身体质量指数": { + "id": 8, + "category": "儿科学", + "name": "女孩(2-20岁)的体质量指数百分比—身体质量指数", + "formula": "体重/(身高/100)**2", + "inputs": [ + "身高", + "体重" + ], + "remarks": "" + }, + "体表面积(DuBois法)—体表面积": { + "id": 89, + "category": "泌尿生殖系统疾病", + "name": "体表面积(DuBois法)—体表面积", + "formula": "0.007184*身高**0.725*体重**0.425", + "inputs": [ + "身高", + "体重" + ], + "remarks": "" + }, + "阴离子间隙—阴离子间隙": { + "id": 290, + "category": "泌尿生殖系统疾病", + "name": "阴离子间隙—阴离子间隙", + "formula": "Na - (Cl + HCO3)", + "inputs": [ + "HCO3", + "Na", + "Cl" + ], + "remarks": "" + }, + "转铁蛋白饱和度—转铁蛋白饱和度": { + "id": 284, + "category": "血液病学及肿瘤病学", + "name": "转铁蛋白饱和度—转铁蛋白饱和度", + "formula": "(血清铁 / 总铁结合力) * 100", + "inputs": [ + "总铁结合力", + "血清铁" + ], + "remarks": "" + }, + "A-a梯度—期望AaG": { + "id": 296, + "category": "内分泌及代谢紊乱", + "name": "A-a梯度—期望AaG", + "formula": "2.5 + (0.21 * 年龄)", + "inputs": [ + "年龄" + ], + "remarks": "" + }, + "肺容积multicalc—功能残气量": { + "id": 13, + "category": "肺部疾病", + "name": "肺容积multicalc—功能残气量", + "formula": "补呼气容积+残气容积", + "inputs": [ + "补呼气容积", + "残气容积" + ], + "remarks": "" + }, + "肺容积multicalc—深吸气量": { + "id": 14, + "category": "肺部疾病", + "name": "肺容积multicalc—深吸气量", + "formula": "补吸气容积+潮气容积", + "inputs": [ + "补吸气容积", + "潮气容积" + ], + "remarks": "" + }, + "肺容积multicalc—肺总量": { + "id": 15, + "category": "肺部疾病", + "name": "肺容积multicalc—肺总量", + "formula": "补吸气容积+潮气容积+补呼气容积+残气容积", + "inputs": [ + "补吸气容积", + "补呼气容积", + "潮气容积", + "残气容积" + ], + "remarks": "" + }, + "肺容积multicalc—肺活量": { + "id": 16, + "category": "肺部疾病", + "name": "肺容积multicalc—肺活量", + "formula": "补吸气容积+潮气容积+补呼气容积", + "inputs": [ + "补吸气容积", + "补呼气容积", + "潮气容积" + ], + "remarks": "" + }, + "肺容积multicalc—闭合气量": { + "id": 17, + "category": "肺部疾病", + "name": "肺容积multicalc—闭合气量", + "formula": "闭合容积+残气容积", + "inputs": [ + "闭合容积", + "残气容积" + ], + "remarks": "" + }, + "肺容积multicalc—闭合容积-肺活量比值": { + "id": 18, + "category": "肺部疾病", + "name": "肺容积multicalc—闭合容积-肺活量比值", + "formula": "100*闭合容积/肺活量", + "inputs": [ + "闭合容积", + "肺活量" + ], + "remarks": "" + }, + "肺容积multicalc—闭合气量-肺总量比值": { + "id": 19, + "category": "肺部疾病", + "name": "肺容积multicalc—闭合气量-肺总量比值", + "formula": "100*闭合气量/肺总量", + "inputs": [ + "闭合气量", + "肺总量" + ], + "remarks": "" + }, + "肺容积multicalc—残气容积-肺总量比值": { + "id": 20, + "category": "肺部疾病", + "name": "肺容积multicalc—残气容积-肺总量比值", + "formula": "100*残气容积/肺总量", + "inputs": [ + "残气容积", + "肺总量" + ], + "remarks": "" + }, + "呼气峰流速预计值—呼气流量峰值女性": { + "id": 21, + "category": "肺部疾病", + "name": "呼气峰流速预计值—呼气流量峰值女性", + "formula": "math.e**((0.376*math.log(年龄))-(0.012*年龄)-(58.8/身高)+5.63)", + "inputs": [ + "身高", + "年龄" + ], + "remarks": "" + }, + "呼气峰流速预计值—呼气流量峰值男性": { + "id": 22, + "category": "肺部疾病", + "name": "呼气峰流速预计值—呼气流量峰值男性", + "formula": "math.e**((0.544*math.log(年龄))-(0.0151*年龄)-(74.7/身高)+5.48)", + "inputs": [ + "身高", + "年龄" + ], + "remarks": "" + }, + "气胸的塌陷程度—百分比气胸": { + "id": 327, + "category": "损伤;中毒", + "name": "气胸的塌陷程度—百分比气胸", + "formula": "100 * (1 - (肺直径**3 / 半胸直径**3))", + "inputs": [ + "半胸直径", + "肺直径" + ], + "remarks": "" + }, + "体质指数(凯特勒指数)—身体质量指数": { + "id": 60, + "category": "精神疾病", + "name": "体质指数(凯特勒指数)—身体质量指数", + "formula": "(体重/2.205)/(身高/39.37)**2", + "inputs": [ + "身高", + "体重" + ], + "remarks": "" + }, + "预测肺切除术后FEV1(灌注法)—术后FEV_1": { + "id": 26, + "category": "肺部疾病", + "name": "预测肺切除术后FEV1(灌注法)—术后FEV_1", + "formula": "术前FEV_1*(1-切除肺中总灌注的分数)", + "inputs": [ + "切除肺中总灌注的分数", + "术前FEV_1" + ], + "remarks": "" + }, + "在吸烟者和既往吸烟者(6年)中患肺癌的风险评估—风险": { + "id": 29, + "category": "肺部疾病", + "name": "在吸烟者和既往吸烟者(6年)中患肺癌的风险评估—风险", + "formula": "100*(math.e**(Log几率)/(1+math.e**(Log几率)))", + "inputs": [ + "Log几率" + ], + "remarks": "" + }, + "肌酐清除率(测定)—肌酐清除率": { + "id": 76, + "category": "泌尿生殖系统疾病", + "name": "肌酐清除率(测定)—肌酐清除率", + "formula": "尿肌酐浓度*每日尿量/血肌酐浓度/1440", + "inputs": [ + "尿肌酐浓度", + "血肌酐浓度", + "每日尿量" + ], + "remarks": "" + }, + "丙型肝炎肝硬化的概率—CDS": { + "id": 35, + "category": "肝脏及胆道疾病", + "name": "丙型肝炎肝硬化的概率—CDS", + "formula": "血小板+AST/ALT+INR", + "inputs": [ + "血小板", + "ALT", + "AST", + "INR" + ], + "remarks": "" + }, + "丙型肝炎肝硬化的概率—日志可能性Lok": { + "id": 36, + "category": "肝脏及胆道疾病", + "name": "丙型肝炎肝硬化的概率—日志可能性Lok", + "formula": "(1.26*AST/ALT)+(5.27*INR)-(0.0089*血小板)-5.56", + "inputs": [ + "AST", + "ALT", + "INR", + "血小板" + ], + "remarks": "" + }, + "丙型肝炎肝硬化的概率—Lok指数": { + "id": 37, + "category": "肝脏及胆道疾病", + "name": "丙型肝炎肝硬化的概率—Lok指数", + "formula": "math.e**(日志可能性Lok) / (1 + math.e**(日志可能性Lok))", + "inputs": [ + "日志可能性Lok" + ], + "remarks": "" + }, + "丙型肝炎肝硬化的概率—GUCI": { + "id": 38, + "category": "肝脏及胆道疾病", + "name": "丙型肝炎肝硬化的概率—GUCI", + "formula": "(AST/顶级正常值AST)*INR*100/血小板", + "inputs": [ + "顶级正常值AST", + "AST", + "INR", + "血小板" + ], + "remarks": "" + }, + "丙型肝炎肝硬化的概率—APRI": { + "id": 39, + "category": "肝脏及胆道疾病", + "name": "丙型肝炎肝硬化的概率—APRI", + "formula": "(AST/顶级正常值AST)*(100/血小板)", + "inputs": [ + "顶级正常值AST", + "AST", + "血小板" + ], + "remarks": "" + }, + "丙型肝炎肝硬化的概率—FIB4": { + "id": 40, + "category": "肝脏及胆道疾病", + "name": "丙型肝炎肝硬化的概率—FIB4", + "formula": "年龄*AST/(血小板*math.sqrt(ALT))", + "inputs": [ + "AST", + "血小板", + "ALT", + "年龄" + ], + "remarks": "" + }, + "腹水白蛋白梯度—血清腹水白蛋白梯度": { + "id": 41, + "category": "肝脏及胆道疾病", + "name": "腹水白蛋白梯度—血清腹水白蛋白梯度", + "formula": "血清白蛋白-腹水白蛋白", + "inputs": [ + "血清白蛋白", + "腹水白蛋白" + ], + "remarks": "" + }, + "糖皮质激素治疗酒精性肝炎的肝炎判别函数—分数": { + "id": 42, + "category": "肝脏及胆道疾病", + "name": "糖皮质激素治疗酒精性肝炎的肝炎判别函数—分数", + "formula": "4.6*(患者凝血酶原时间-凝血酶原时间参考值)+血总胆红素", + "inputs": [ + "凝血酶原时间参考值", + "患者凝血酶原时间", + "血总胆红素" + ], + "remarks": "" + }, + "终末期肝病MELDNa评分(不适合12岁以下患者)—MELDNa评分": { + "id": 295, + "category": "免疫学;过敏性疾病", + "name": "终末期肝病MELDNa评分(不适合12岁以下患者)—MELDNa评分", + "formula": "10 * ((0.957 * math.log(肌酐)) + (0.378 * math.log(胆红素)) + (1.12 * math.log(国际标准化比率))) + 6.43 - 血清钠 - (0.025 * 10 * ((0.957 * math.log(肌酐)) + (0.378 * math.log(胆红素)) + (1.12 * math.log(国际标准化比率))) + 6.43 * (140 - 血清钠)) + 140", + "inputs": [ + "国际标准化比率", + "胆红素", + "血清钠", + "肌酐" + ], + "remarks": "" + }, + "Na排泄分数—钠排泄分数": { + "id": 70, + "category": "泌尿生殖系统疾病", + "name": "Na排泄分数—钠排泄分数", + "formula": "(尿钠/血清钠)/(尿肌酐/血清肌酐)*100", + "inputs": [ + "血清肌酐", + "血清钠", + "尿肌酐", + "尿钠" + ], + "remarks": "" + }, + "PaO2/FIO2比值(MODS计算)—动脉氧分压吸入氧浓度比率": { + "id": 46, + "category": "急救医学", + "name": "PaO2/FIO2比值(MODS计算)—动脉氧分压吸入氧浓度比率", + "formula": "动脉氧分压/吸入氧浓度", + "inputs": [ + "动脉氧分压", + "吸入氧浓度" + ], + "remarks": "" + }, + "儿童气管导管大小(1到8周岁)—无囊气管导管大小": { + "id": 47, + "category": "急救医学", + "name": "儿童气管导管大小(1到8周岁)—无囊气管导管大小", + "formula": "4+(年龄/4)", + "inputs": [ + "年龄" + ], + "remarks": "" + }, + "儿童气管导管大小(1到8周岁)—有囊气管导管大小": { + "id": 48, + "category": "急救医学", + "name": "儿童气管导管大小(1到8周岁)—有囊气管导管大小", + "formula": "3.5+(年龄/4)", + "inputs": [ + "年龄" + ], + "remarks": "" + }, + "平均血管压力(体循环或肺循环)—平均血管压力": { + "id": 324, + "category": "神经系统疾病", + "name": "平均血管压力(体循环或肺循环)—平均血管压力", + "formula": "舒张压 + ((收缩压 - 舒张压) / 3)", + "inputs": [ + "收缩压", + "舒张压" + ], + "remarks": "" + }, + "心输出量—CaO2": { + "id": 266, + "category": "心血管疾病", + "name": "心输出量—CaO2", + "formula": "( Hgb * 13.4 * O2Sat / 100 ) + ( PaO2 * 0.031 )", + "inputs": [ + "O2Sat", + "PaO2", + "Hgb" + ], + "remarks": "" + }, + "心输出量—CvO2": { + "id": 53, + "category": "急救医学", + "name": "心输出量—CvO2", + "formula": "(Hgb*13.4*O2vSat/100)+(PvO2*0.031)", + "inputs": [ + "O2vSat", + "PvO2", + "Hgb" + ], + "remarks": "" + }, + "心输出量—CO": { + "id": 54, + "category": "急救医学", + "name": "心输出量—CO", + "formula": "O2消耗量/(CaO2-CvO2)", + "inputs": [ + "O2消耗量", + "CaO2", + "CvO2" + ], + "remarks": "" + }, + "心输出量Multicalc—心输出量": { + "id": 269, + "category": "心血管疾病", + "name": "心输出量Multicalc—心输出量", + "formula": "耗氧量 / (动脉氧含量 - 静脉氧含量)", + "inputs": [ + "动脉氧含量", + "静脉氧含量", + "耗氧量" + ], + "remarks": "" + }, + "心输出量Multicalc—体表面积": { + "id": 270, + "category": "心血管疾病", + "name": "心输出量Multicalc—体表面积", + "formula": "0.007184 * 身高**0.725 * 体重**0.425", + "inputs": [ + "身高", + "体重" + ], + "remarks": "" + }, + "心输出量Multicalc—心脏指数": { + "id": 271, + "category": "心血管疾病", + "name": "心输出量Multicalc—心脏指数", + "formula": "耗氧量 / (动脉氧含量 - 静脉氧含量)/(0.007184 * 身高**0.725 * 体重**0.425)", + "inputs": [ + "动脉氧含量", + "静脉氧含量", + "耗氧量", + "身高", + "体重" + ], + "remarks": "" + }, + "心输出量Multicalc—每搏输出量": { + "id": 272, + "category": "心血管疾病", + "name": "心输出量Multicalc—每搏输出量", + "formula": "1000 *耗氧量 / (动脉氧含量 - 静脉氧含量) / 心率", + "inputs": [ + "动脉氧含量", + "静脉氧含量", + "耗氧量", + "心率" + ], + "remarks": "" + }, + "心输出量Multicalc—每搏输出量指数": { + "id": 273, + "category": "心血管疾病", + "name": "心输出量Multicalc—每搏输出量指数", + "formula": "(1000 *耗氧量 / ((动脉氧含量 - 静脉氧含量)) / 心率)/ 体表面积", + "inputs": [ + "动脉氧含量", + "静脉氧含量", + "体表面积", + "耗氧量", + "心率" + ], + "remarks": "" + }, + "获益增加/需要处理多尺度的数目—绝对获益增加率": { + "id": 66, + "category": "临床药理学", + "name": "获益增加/需要处理多尺度的数目—绝对获益增加率", + "formula": "对照组事件发生率-试验组事件发生率", + "inputs": [ + "对照组事件发生率", + "试验组事件发生率" + ], + "remarks": "" + }, + "获益增加/需要处理多尺度的数目—相对获益增加率": { + "id": 67, + "category": "临床药理学", + "name": "获益增加/需要处理多尺度的数目—相对获益增加率", + "formula": "绝对获益增加率/对照组事件发生率", + "inputs": [ + "对照组事件发生率", + "绝对获益增加率" + ], + "remarks": "" + }, + "获益增加/需要处理多尺度的数目—NNT": { + "id": 68, + "category": "临床药理学", + "name": "获益增加/需要处理多尺度的数目—NNT", + "formula": "1/绝对获益增加率", + "inputs": [ + "绝对获益增加率" + ], + "remarks": "" + }, + "Na排泄分数(SI单位)—钠排泄分数": { + "id": 71, + "category": "泌尿生殖系统疾病", + "name": "Na排泄分数(SI单位)—钠排泄分数", + "formula": "(尿钠/血清钠)/(尿肌酐/血清肌酐)*100", + "inputs": [ + "血清肌酐", + "血清钠", + "尿肌酐", + "尿钠" + ], + "remarks": "" + }, + "低白蛋白血症时的阴离子间隙—阴离子间隙": { + "id": 302, + "category": "内分泌及代谢紊乱", + "name": "低白蛋白血症时的阴离子间隙—阴离子间隙", + "formula": "钠 - 氯 - 碳酸氢根", + "inputs": [ + "碳酸氢根", + "钠", + "氯" + ], + "remarks": "" + }, + "低白蛋白血症时的阴离子间隙—校正间隙": { + "id": 73, + "category": "泌尿生殖系统疾病", + "name": "低白蛋白血症时的阴离子间隙—校正间隙", + "formula": "阴离子间隙+2.5*(正常白蛋白-观察到白蛋白)", + "inputs": [ + "观察到白蛋白", + "阴离子间隙", + "正常白蛋白" + ], + "remarks": "" + }, + "分布容积—尿素分布容积女性": { + "id": 74, + "category": "泌尿生殖系统疾病", + "name": "分布容积—尿素分布容积女性", + "formula": "(0.1069*身高)+(0.2466*体重)-2.097", + "inputs": [ + "身高", + "体重" + ], + "remarks": "" + }, + "分布容积—尿素分布容积男性": { + "id": 75, + "category": "泌尿生殖系统疾病", + "name": "分布容积—尿素分布容积男性", + "formula": "2.447-(0.09516*年龄)+(0.1074*身高)+(0.3362*体重)", + "inputs": [ + "年龄", + "身高", + "体重" + ], + "remarks": "" + }, + "肌酐清除率(衡量SI单位)—肌酐清除率": { + "id": 77, + "category": "泌尿生殖系统疾病", + "name": "肌酐清除率(衡量SI单位)—肌酐清除率", + "formula": "尿肌酐*天数尿量/血清肌酐/86400", + "inputs": [ + "天数尿量", + "血清肌酐", + "尿肌酐" + ], + "remarks": "" + }, + "净体重(男)—去脂体重": { + "id": 78, + "category": "泌尿生殖系统疾病", + "name": "净体重(男)—去脂体重", + "formula": "(0.73*身高)-59.42", + "inputs": [ + "身高" + ], + "remarks": "" + }, + "净体重(女)—去脂体重": { + "id": 79, + "category": "泌尿生殖系统疾病", + "name": "净体重(女)—去脂体重", + "formula": "(0.65*身高)-50.74", + "inputs": [ + "身高" + ], + "remarks": "" + }, + "尿蛋白排泄评估—蛋白质排泄": { + "id": 81, + "category": "泌尿生殖系统疾病", + "name": "尿蛋白排泄评估—蛋白质排泄", + "formula": "随机尿蛋白/随机尿肌酐", + "inputs": [ + "随机尿蛋白", + "随机尿肌酐" + ], + "remarks": "" + }, + "尿素清除指数透析剂量多重计算公式—Kt/VLowrie": { + "id": 83, + "category": "泌尿生殖系统疾病", + "name": "尿素清除指数透析剂量多重计算公式—Kt/VLowrie", + "formula": "math.log(透析前尿素氮/透析后尿素氮)", + "inputs": [ + "透析后尿素氮", + "透析前尿素氮" + ], + "remarks": "" + }, + "尿素清除指数透析剂量多重计算公式—Kt/VKeshaviah": { + "id": 84, + "category": "泌尿生殖系统疾病", + "name": "尿素清除指数透析剂量多重计算公式—Kt/VKeshaviah", + "formula": "1.162*math.log(透析前尿素氮/透析后尿素氮)", + "inputs": [ + "透析后尿素氮", + "透析前尿素氮" + ], + "remarks": "" + }, + "尿素清除指数透析剂量多重计算公式—Kt/VBarth": { + "id": 85, + "category": "泌尿生殖系统疾病", + "name": "尿素清除指数透析剂量多重计算公式—Kt/VBarth", + "formula": "3.1*((透析前尿素氮-透析后尿素氮)/透析前尿素氮)-0.66", + "inputs": [ + "透析后尿素氮", + "透析前尿素氮" + ], + "remarks": "" + }, + "尿素清除指数透析剂量多重计算公式—Kt/VBasile": { + "id": 86, + "category": "泌尿生殖系统疾病", + "name": "尿素清除指数透析剂量多重计算公式—Kt/VBasile", + "formula": "2.3*((透析前尿素氮-透析后尿素氮)/透析前尿素氮)-0.284", + "inputs": [ + "透析后尿素氮", + "透析前尿素氮" + ], + "remarks": "" + }, + "尿素清除指数透析剂量多重计算公式—Kt/VJindal": { + "id": 87, + "category": "泌尿生殖系统疾病", + "name": "尿素清除指数透析剂量多重计算公式—Kt/VJindal", + "formula": "4*((透析前尿素氮-透析后尿素氮)/透析前尿素氮)-1.2", + "inputs": [ + "透析后尿素氮", + "透析前尿素氮" + ], + "remarks": "" + }, + "尿素清除指数透析剂量多重计算公式—Kt/VKerr": { + "id": 88, + "category": "泌尿生殖系统疾病", + "name": "尿素清除指数透析剂量多重计算公式—Kt/VKerr", + "formula": "4.2*((透析前尿素氮-透析后尿素氮)/透析前尿素氮)-1.48", + "inputs": [ + "透析后尿素氮", + "透析前尿素氮" + ], + "remarks": "" + }, + "血液透析中尿素百分比的降低(PRU)—尿素减少百分比": { + "id": 288, + "category": "泌尿生殖系统疾病", + "name": "血液透析中尿素百分比的降低(PRU)—尿素减少百分比", + "formula": "100 * (血液透析前尿素量 - 血液透析后尿素量) / 血液透析前尿素量", + "inputs": [ + "血液透析前尿素量", + "血液透析后尿素量" + ], + "remarks": "" + }, + "阴离子间隙DeltaDelta梯度Multicalc—Delta间隙": { + "id": 291, + "category": "泌尿生殖系统疾病", + "name": "阴离子间隙DeltaDelta梯度Multicalc—Delta间隙", + "formula": "Na - (Cl + HCO3) - 基线间隙", + "inputs": [ + "HCO3", + "基线间隙", + "Na", + "Cl" + ], + "remarks": "" + }, + "阴离子间隙DeltaDelta梯度Multicalc—DeltaDelta梯度": { + "id": 292, + "category": "泌尿生殖系统疾病", + "name": "阴离子间隙DeltaDelta梯度Multicalc—DeltaDelta梯度", + "formula": "Na - (Cl + HCO3) - 基线间隙 - Delta碳酸氢盐", + "inputs": [ + "Delta碳酸氢盐", + "HCO3", + "基线间隙", + "Na", + "Cl" + ], + "remarks": "" + }, + "中性粒细胞绝对计数—绝对嗜中性粒细胞计数": { + "id": 293, + "category": "免疫学;过敏性疾病", + "name": "中性粒细胞绝对计数—绝对嗜中性粒细胞计数", + "formula": "白细胞计数 * ((分叶核粒细胞百分比/100) + (杆状核粒细胞百分比/100))", + "inputs": [ + "分叶核粒细胞百分比", + "杆状核粒细胞百分比", + "白细胞计数" + ], + "remarks": "" + }, + "A-a梯度—实测AaG": { + "id": 297, + "category": "内分泌及代谢紊乱", + "name": "A-a梯度—实测AaG", + "formula": "(吸入氧百分数 / 100 *(((760 * math.e*((海拔/-7000) - 47 * math.e*((患者体温-37)/18.4)))))) - (pCO2 / 呼吸交换率) + (pCO2 * 吸入氧百分数 / 100 * (1 - 呼吸交换率) / 呼吸交换率) - paO2", + "inputs": [ + "吸入氧百分数", + "呼吸交换率", + "患者体温", + "pCO2", + "paO2", + "海拔" + ], + "remarks": "" + }, + "Henderson-Hasselbach方程—pH": { + "id": 298, + "category": "内分泌及代谢紊乱", + "name": "Henderson-Hasselbach方程—pH", + "formula": "6.1 + math.log(HCO3 / (0.03 * PaCO2))", + "inputs": [ + "PaCO2", + "HCO3" + ], + "remarks": "" + }, + "Winters公式估算PCO2—PCO2": { + "id": 301, + "category": "内分泌及代谢紊乱", + "name": "Winters公式估算PCO2—PCO2", + "formula": "HCO3 * 1.5 + 8", + "inputs": [ + "HCO3" + ], + "remarks": "" + }, + "低白蛋白血症的校正钙(国际单位)—校正血清钙": { + "id": 303, + "category": "内分泌及代谢紊乱", + "name": "低白蛋白血症的校正钙(国际单位)—校正血清钙", + "formula": "测量血清钙 + 0.02 * (正常血清白蛋白 - 患者血清白蛋白)", + "inputs": [ + "正常血清白蛋白", + "患者血清白蛋白", + "测量血清钙" + ], + "remarks": "" + }, + "基于体重的体内总水量估计—总体液量": { + "id": 309, + "category": "内分泌及代谢紊乱", + "name": "基于体重的体内总水量估计—总体液量", + "formula": "体重 * 0.58", + "inputs": [ + "体重" + ], + "remarks": "" + }, + "女性体内总水量(沃森公式)—总体液量": { + "id": 310, + "category": "内分泌及代谢紊乱", + "name": "女性体内总水量(沃森公式)—总体液量", + "formula": "(0.1069 * 身高) + (0.2466 * 体重) - 2.097", + "inputs": [ + "身高", + "体重" + ], + "remarks": "" + }, + "尿液阴离子间隙—尿液阴离子间隙": { + "id": 311, + "category": "内分泌及代谢紊乱", + "name": "尿液阴离子间隙—尿液阴离子间隙", + "formula": "(钠 + 钾) - 氯", + "inputs": [ + "钠", + "钾", + "氯" + ], + "remarks": "" + }, + "极低密度脂蛋白(VLDL)—极低密度脂蛋白": { + "id": 312, + "category": "内分泌及代谢紊乱", + "name": "极低密度脂蛋白(VLDL)—极低密度脂蛋白", + "formula": "甘油三酯 / 5", + "inputs": [ + "甘油三酯" + ], + "remarks": "" + }, + "渗透压估计(血清)—渗透压度": { + "id": 313, + "category": "内分泌及代谢紊乱", + "name": "渗透压估计(血清)—渗透压度", + "formula": "(钠 * 2) + (葡萄糖 / 18) + (血尿素氮 / 2.8)", + "inputs": [ + "血尿素氮", + "葡萄糖", + "钠" + ], + "remarks": "" + }, + "男性体内总水量(沃森公式)—总体液量": { + "id": 315, + "category": "内分泌及代谢紊乱", + "name": "男性体内总水量(沃森公式)—总体液量", + "formula": "2.447 - (0.09156 * 年龄) + (0.1074 * 身高) + (0.3362 * 体重)", + "inputs": [ + "年龄", + "身高", + "体重" + ], + "remarks": "" + }, + "糖尿病风险自我评估—身体质量指数(BMI)": { + "id": 316, + "category": "内分泌及代谢紊乱", + "name": "糖尿病风险自我评估—身体质量指数(BMI)", + "formula": "(体重/2.205) / (身高/39.37)**2", + "inputs": [ + "体重", + "身高" + ], + "remarks": "" + }, + "计算低密度脂蛋白胆固醇的Friedewald公式—LDL": { + "id": 318, + "category": "内分泌及代谢紊乱", + "name": "计算低密度脂蛋白胆固醇的Friedewald公式—LDL", + "formula": "总胆固醇 - (甘油三酯 / 5) - HDL", + "inputs": [ + "总胆固醇", + "甘油三酯", + "HDL" + ], + "remarks": "" + }, + "高甘油三酯血症时的血钠改变—Na变化": { + "id": 320, + "category": "内分泌及代谢紊乱", + "name": "高甘油三酯血症时的血钠改变—Na变化", + "formula": "甘油三酯 * 0.002", + "inputs": [ + "甘油三酯" + ], + "remarks": "" + }, + "高蛋白血症时的血钠变化—钠变化": { + "id": 321, + "category": "内分泌及代谢紊乱", + "name": "高蛋白血症时的血钠变化—钠变化", + "formula": "(血清蛋白 - 8) * 0.25", + "inputs": [ + "血清蛋白" + ], + "remarks": "" + }, + "高血糖时低钠的处理—校正血清钠": { + "id": 322, + "category": "内分泌及代谢紊乱", + "name": "高血糖时低钠的处理—校正血清钠", + "formula": "测量血清钠 + 0.016 * (血糖 - 100)", + "inputs": [ + "测量血清钠", + "血糖" + ], + "remarks": "" + }, + "血液污染脑脊液的白细胞计数校正—白细胞": { + "id": 325, + "category": "神经系统疾病", + "name": "血液污染脑脊液的白细胞计数校正—白细胞", + "formula": "白细胞脑脊液 - ( (白细胞血液 * 红细胞脑脊液) / (红细胞血液 * 1000000))", + "inputs": [ + "白细胞脑脊液", + "红细胞脑脊液", + "白细胞血液", + "红细胞血液" + ], + "remarks": "" + }, + "血液污染脑脊液的蛋白浓度校正—蛋白质": { + "id": 326, + "category": "神经系统疾病", + "name": "血液污染脑脊液的蛋白浓度校正—蛋白质", + "formula": "蛋白质脑脊液 - (蛋白质血清 * 1000 * (1 - 红细胞比容 / 100) * 红细胞脑脊液 / (红细胞血液 * 1e6))", + "inputs": [ + "蛋白质脑脊液", + "红细胞脑脊液", + "蛋白质血清", + "红细胞比容", + "红细胞血液" + ], + "remarks": "" + }, + "烧伤液体复苏,成人(Parkland公式)—第一个24小时晶体液总量": { + "id": 328, + "category": "损伤;中毒", + "name": "烧伤液体复苏,成人(Parkland公式)—第一个24小时晶体液总量", + "formula": "4 * 体重 * 非体表烧伤面积百分位数", + "inputs": [ + "非体表烧伤面积百分位数", + "体重" + ], + "remarks": "" + }, + "烧伤液体复苏,成人(Parkland公式)—第一个8小时率": { + "id": 329, + "category": "损伤;中毒", + "name": "烧伤液体复苏,成人(Parkland公式)—第一个8小时率", + "formula": "( 4 * 体重 * 非体表烧伤面积百分位数 )/ 16", + "inputs": [ + "非体表烧伤面积百分位数", + "体重" + ], + "remarks": "" + }, + "烧伤液体复苏,成人(Parkland公式)—之后16小时率": { + "id": 330, + "category": "损伤;中毒", + "name": "烧伤液体复苏,成人(Parkland公式)—之后16小时率", + "formula": "( 4 * 体重 * 非体表烧伤面积百分位数 )/ 32", + "inputs": [ + "非体表烧伤面积百分位数", + "体重" + ], + "remarks": "" + }, + "似然比—阳性似然比": { + "id": 331, + "category": "特殊问题", + "name": "似然比—阳性似然比", + "formula": "敏感性 / (1-特异性)", + "inputs": [ + "敏感性", + "特异性" + ], + "remarks": "" + }, + "来自原始数据的阳性似然比—敏感性": { + "id": 210, + "category": "特殊问题", + "name": "来自原始数据的阳性似然比—敏感性", + "formula": "真阳性 / (真阳性 + 假阴性)", + "inputs": [ + "真阳性", + "假阴性" + ], + "remarks": "" + }, + "来自原始数据的阳性似然比—特异性": { + "id": 211, + "category": "特殊问题", + "name": "来自原始数据的阳性似然比—特异性", + "formula": "真阴性 / (真阴性 + 假阳性)", + "inputs": [ + "真阴性", + "假阳性" + ], + "remarks": "" + }, + "来自原始数据的阳性似然比—阳性似然比": { + "id": 212, + "category": "特殊问题", + "name": "来自原始数据的阳性似然比—阳性似然比", + "formula": "敏感性 / (1-特异性)", + "inputs": [ + "敏感性", + "特异性" + ], + "remarks": "" + }, + "来自原始数据的阳性预测值—阳性预测值": { + "id": 213, + "category": "特殊问题", + "name": "来自原始数据的阳性预测值—阳性预测值", + "formula": "100 * 真阳性 / (真阳性 + 假阳性)", + "inputs": [ + "真阳性", + "假阳性" + ], + "remarks": "" + }, + "来自原始数据的阴性似然比—敏感性": { + "id": 214, + "category": "特殊问题", + "name": "来自原始数据的阴性似然比—敏感性", + "formula": "真阳性 / (真阳性 + 假阴性)", + "inputs": [ + "真阳性", + "假阴性" + ], + "remarks": "" + }, + "来自原始数据的阴性似然比—特异性": { + "id": 215, + "category": "特殊问题", + "name": "来自原始数据的阴性似然比—特异性", + "formula": "真阴性 / (真阴性 + 假阳性)", + "inputs": [ + "真阴性", + "假阳性" + ], + "remarks": "" + }, + "来自原始数据的阴性似然比—阴性似然比": { + "id": 216, + "category": "特殊问题", + "name": "来自原始数据的阴性似然比—阴性似然比", + "formula": "(1-敏感性) / 特异性", + "inputs": [ + "敏感性", + "特异性" + ], + "remarks": "" + }, + "来自原始数据的阴性预测值—阴性预测值": { + "id": 217, + "category": "特殊问题", + "name": "来自原始数据的阴性预测值—阴性预测值", + "formula": "100 * 真阴性 / (真阴性 + 假阴性)", + "inputs": [ + "真阴性", + "假阴性" + ], + "remarks": "" + }, + "来自概率的比数—几率": { + "id": 218, + "category": "特殊问题", + "name": "来自概率的比数—几率", + "formula": "可能性 / (1 - 可能性)", + "inputs": [ + "可能性" + ], + "remarks": "" + }, + "来自比数的概率—可能性": { + "id": 219, + "category": "特殊问题", + "name": "来自比数的概率—可能性", + "formula": "几率 / (1 + 几率)", + "inputs": [ + "几率" + ], + "remarks": "" + }, + "检查的阳性预测值—PPV": { + "id": 220, + "category": "特殊问题", + "name": "检查的阳性预测值—PPV", + "formula": "100 * (流行性 * 敏感性) / (流行性 * 敏感性 + ((1 - 流行性) * (1 - 特异性)))", + "inputs": [ + "流行性", + "敏感性", + "特异性" + ], + "remarks": "" + }, + "检查的阴性预测值—NPV": { + "id": 221, + "category": "特殊问题", + "name": "检查的阴性预测值—NPV", + "formula": "100 * ((1 - 流行性) * 特异性) / ((1-流行性) * 特异性 + (流行性 * (1 - 敏感性)))", + "inputs": [ + "流行性", + "敏感性", + "特异性" + ], + "remarks": "" + }, + "源于灵敏度和患病率的假阴性—真阳性": { + "id": 222, + "category": "特殊问题", + "name": "源于灵敏度和患病率的假阴性—真阳性", + "formula": "敏感性 * 患病率", + "inputs": [ + "敏感性", + "患病率" + ], + "remarks": "" + }, + "源于灵敏度和患病率的假阴性—假阴性": { + "id": 223, + "category": "特殊问题", + "name": "源于灵敏度和患病率的假阴性—假阴性", + "formula": "(1 - 敏感性) * 患病率", + "inputs": [ + "敏感性", + "患病率" + ], + "remarks": "" + }, + "源于灵敏度和患病率的假阴性—验前比": { + "id": 224, + "category": "特殊问题", + "name": "源于灵敏度和患病率的假阴性—验前比", + "formula": "患病率 / (1 - 患病率)", + "inputs": [ + "患病率" + ], + "remarks": "" + }, + "源于灵敏度和患病率的假阴性—假阴性率": { + "id": 225, + "category": "特殊问题", + "name": "源于灵敏度和患病率的假阴性—假阴性率", + "formula": "100 * 假阴性 / (真阳性 + 假阴性)", + "inputs": [ + "真阳性", + "假阴性" + ], + "remarks": "" + }, + "源于特异性和患病率的假阳性—假阳性": { + "id": 226, + "category": "特殊问题", + "name": "源于特异性和患病率的假阳性—假阳性", + "formula": "(1 - 特异性) * (1 - 患病率)", + "inputs": [ + "特异性", + "患病率" + ], + "remarks": "" + }, + "源于特异性和患病率的假阳性—真阴性": { + "id": 227, + "category": "特殊问题", + "name": "源于特异性和患病率的假阳性—真阴性", + "formula": "特异性 * (1 - 患病率)", + "inputs": [ + "特异性", + "患病率" + ], + "remarks": "" + }, + "源于特异性和患病率的假阳性—假阳性率": { + "id": 228, + "category": "特殊问题", + "name": "源于特异性和患病率的假阳性—假阳性率", + "formula": "100 * 假阳性 / (假阳性 + 真阴性)", + "inputs": [ + "假阳性", + "真阴性" + ], + "remarks": "" + }, + "试验的敏感性—敏感性": { + "id": 229, + "category": "特殊问题", + "name": "试验的敏感性—敏感性", + "formula": "100 * 真阳性 / (真阳性 + 假阴性)", + "inputs": [ + "真阳性", + "假阴性" + ], + "remarks": "" + }, + "试验的特异性—特异性": { + "id": 230, + "category": "特殊问题", + "name": "试验的特异性—特异性", + "formula": "100 * 真阴性 / (真阴性 + 假阳性)", + "inputs": [ + "假阳性", + "真阴性" + ], + "remarks": "" + }, + "贝叶斯统计—真阳性": { + "id": 231, + "category": "特殊问题", + "name": "贝叶斯统计—真阳性", + "formula": "敏感性 * 患病率", + "inputs": [ + "敏感性", + "患病率" + ], + "remarks": "" + }, + "贝叶斯统计—假阳性": { + "id": 232, + "category": "特殊问题", + "name": "贝叶斯统计—假阳性", + "formula": "(1 - 特异性) * (1 - 患病率)", + "inputs": [ + "特异性", + "患病率" + ], + "remarks": "" + }, + "贝叶斯统计—真阴性": { + "id": 233, + "category": "特殊问题", + "name": "贝叶斯统计—真阴性", + "formula": "特异性 * (1 - 患病率)", + "inputs": [ + "特异性", + "患病率" + ], + "remarks": "" + }, + "贝叶斯统计—假阴性": { + "id": 234, + "category": "特殊问题", + "name": "贝叶斯统计—假阴性", + "formula": "(1 - 敏感性) * 患病率", + "inputs": [ + "敏感性", + "患病率" + ], + "remarks": "" + }, + "贝叶斯统计—阳性预测值": { + "id": 235, + "category": "特殊问题", + "name": "贝叶斯统计—阳性预测值", + "formula": "100 * 真阳性 / (真阳性 + 假阳性)", + "inputs": [ + "真阳性", + "假阳性" + ], + "remarks": "" + }, + "贝叶斯统计—阴性预测值": { + "id": 236, + "category": "特殊问题", + "name": "贝叶斯统计—阴性预测值", + "formula": "100 * 真阴性 / (真阴性 + 假阴性)", + "inputs": [ + "真阴性", + "假阴性" + ], + "remarks": "" + }, + "贝叶斯统计—阳性似然比": { + "id": 237, + "category": "特殊问题", + "name": "贝叶斯统计—阳性似然比", + "formula": "敏感性 / (1-特异性)", + "inputs": [ + "敏感性", + "特异性" + ], + "remarks": "" + }, + "贝叶斯统计—检验前几率比值比": { + "id": 239, + "category": "特殊问题", + "name": "贝叶斯统计—检验前几率比值比", + "formula": "患病率 / (1 - 患病率)", + "inputs": [ + "患病率" + ], + "remarks": "" + }, + "贝叶斯统计—检验后阳性率比值比": { + "id": 240, + "category": "特殊问题", + "name": "贝叶斯统计—检验后阳性率比值比", + "formula": "患病率 / (1 - 患病率) *( 敏感性 / (1-特异性))", + "inputs": [ + "患病率", + "敏感性", + "特异性" + ], + "remarks": "" + }, + "贝叶斯统计—假阳性率": { + "id": 244, + "category": "特殊问题", + "name": "贝叶斯统计—假阳性率", + "formula": "100 * 假阳性 / (假阳性 + 真阴性)", + "inputs": [ + "假阳性", + "真阴性" + ], + "remarks": "" + }, + "贝叶斯统计—假阴性率": { + "id": 245, + "category": "特殊问题", + "name": "贝叶斯统计—假阴性率", + "formula": "100 * 假阴性 / (真阳性 + 假阴性)", + "inputs": [ + "真阳性", + "假阴性" + ], + "remarks": "" + }, + "贝叶斯统计—总体准确度": { + "id": 246, + "category": "特殊问题", + "name": "贝叶斯统计—总体准确度", + "formula": "100 * (真阳性 + 真阴性)", + "inputs": [ + "真阳性", + "真阴性" + ], + "remarks": "" + }, + "嗜酸性粒细胞计数—嗜酸性粒细胞绝对计数": { + "id": 279, + "category": "血液病学及肿瘤病学", + "name": "嗜酸性粒细胞计数—嗜酸性粒细胞绝对计数", + "formula": "WBC * 嗜酸性粒细胞 / 100", + "inputs": [ + "嗜酸性粒细胞", + "WBC" + ], + "remarks": "" + }, + "淋巴细胞绝对值—绝对淋巴细胞计数": { + "id": 280, + "category": "血液病学及肿瘤病学", + "name": "淋巴细胞绝对值—绝对淋巴细胞计数", + "formula": "白细胞计数 * 淋巴细胞百分比 / 100", + "inputs": [ + "淋巴细胞百分比", + "白细胞计数" + ], + "remarks": "" + }, + "网织红细胞计数绝对值—绝对网织红细胞计数": { + "id": 282, + "category": "血液病学及肿瘤病学", + "name": "网织红细胞计数绝对值—绝对网织红细胞计数", + "formula": "网织红细胞百分比 * 血细胞比容 / 45", + "inputs": [ + "网织红细胞百分比", + "血细胞比容" + ], + "remarks": "" + }, + "基础热量需要量—基础能量消耗女性": { + "id": 286, + "category": "营养性疾病", + "name": "基础热量需要量—基础能量消耗女性", + "formula": "655.1 + (9.563 * 体重) + (1.85 * 身高) - (4.676 * 年龄)", + "inputs": [ + "体重", + "身高", + "年龄" + ], + "remarks": "" + }, + "基础热量需要量—基础能量消耗男性": { + "id": 287, + "category": "营养性疾病", + "name": "基础热量需要量—基础能量消耗男性", + "formula": "66.5 + (13.75 * 体重) + (5.003 * 身高) - (6.775 * 年龄)", + "inputs": [ + "体重", + "身高", + "年龄" + ], + "remarks": "" + } + }, + "scale": { + "Apgar Score": { + "id": 4, + "category": "儿科学", + "name": "Apgar Score", + "points": { + "心率强度和规律": { + "100 次/分或以上": 2, + "低于 100": 1, + "无": 0 + }, + "肺成熟度": { + "呼吸规律": 2, + "不规律": 1, + "无": 0 + }, + "肌肉张力和运动": { + "活跃": 2, + "中等": 1, + "疲弱": 0 + }, + "皮肤颜色/氧合功能": { + "紫色": 2, + "深青色": 1, + "完全呈蓝色": 0 + }, + "对刺激物的反射反应": { + "哭泣": 2, + "抽泣": 1, + "沉默": 0 + } + }, + "rating interpretation": "7-10分:正常\n0-6分:紧张", + "remarks": "" + }, + "EPWORTH睡眠量表(ESS)": { + "id": 188, + "category": "神经系统疾病", + "name": "EPWORTH睡眠量表(ESS)", + "points": { + "坐着阅读时": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + }, + "看电视时": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + }, + "在公众场合安静坐着": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + }, + "坐车一小时": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + }, + "下午躺着休息时": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + }, + "坐着与人交谈时": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + }, + "午餐后安静坐着时(午餐不喝酒)": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + }, + "坐在车里,当车子由于交通问题停下来数分钟时": { + "不会打瞌睡": 0, + "打瞌睡的可能性很小": 1, + "打瞌睡的可能性中等": 2, + "很大可能打瞌睡": 3 + } + }, + "rating interpretation": "1 - 6 分数:\t睡眠正常\n7 - 8 分数:\t一般性嗜睡\n9 - 24 分数:\t不正常(可能病理性的)嗜睡", + "remarks": "" + }, + "成人社区获得性肺炎严重程度评分": { + "id": 45, + "category": "肺部疾病", + "name": "成人社区获得性肺炎严重程度评分", + "points": { + "性别": { + "男": 0, + "女": -10 + }, + "人口因素": { + "疗养院居民": 10 + }, + "伴发疾病": { + "肿瘤疾病": 30, + "肝脏疾病": 20, + "心力衰竭": 10, + "脑血管疾病": 10, + "肾脏疾病": 10 + }, + "身体检查结果": { + "精神状态改变": 20, + "呼吸速率>=30/分钟": 20, + "收缩压<90 mmHg": 20, + "体温<35°C (95°F) 或 >=40°C (104°F)": 15, + "脉率>=125/分钟": 10 + }, + "实验室和影像学结果": { + "动脉 pH <7.35": 30, + "血尿素氮>=30 mg/dL (11 mmol/L)": 20, + "钠<130 mEq/L": 20, + "葡萄糖 >=250 mg/dL (14 mmol/L)": 10, + "血细胞比容 <30%": 10, + "动脉氧气分压<60 mmHg 或氧饱和度<90%": 10, + "胸膜积液": 10 + } + }, + "rating interpretation": "I 级 0.1% 的死亡率\n0 - 70 分数:\tII 级 0.6% 的死亡率\n71 - 90 分数:\tIII 级 0.9% 的死亡率\n91 - 130 分数:\tIV 级 9.3% 的死亡率\n131 - 395 分数:\tV 级 27.0% 的死亡率", + "remarks": "" + }, + "肝病严重程度的Child Pugh分类": { + "id": 76, + "category": "肝脏及胆道疾病", + "name": "肝病严重程度的Child Pugh分类", + "points": { + "脑病": { + "无": 1, + "1 级:改变了心情/意识模糊": 2, + "2 级:不适当的行为、即将发生的木僵、嗜睡": 2, + "3 级:显著的意识模糊,不省人事但可唤醒": 3, + "4 级:昏睡/反应迟钝": 3 + }, + "腹水": { + "消失": 1, + "极轻": 2, + "中度": 3 + }, + "胆红素": { + "<2 mg/dL": 1, + "2-3 mg/dL": 2, + ">3 mg/dL": 3 + }, + "白蛋白": { + ">3.5 g/dL": 1, + "2.8-3.5 g/dL": 2, + "<2.8 g/dL": 3 + }, + "凝血酶原时间延长": { + "比对照者少 4 秒/INR <1.7": 1, + "比对照者高 4-6 秒/INR 1.7-2.3": 2, + "比对照者多 6 秒/INR >2.3": 3 + } + }, + "rating interpretation": "5 - 6 分值:\t儿童 A 级\n7 - 9 分值:\t儿童 B 级\n10 - 15 分值:\t儿童 C 级", + "remarks": "" + }, + "自身免疫性肝炎诊断标准": { + "id": 78, + "category": "肝脏及胆道疾病", + "name": "自身免疫性肝炎诊断标准", + "points": { + "性别": { + "女": 2, + "男": 0 + }, + "碱性磷酸酶/氨酸转氨酶比率": { + ">3.0": -2, + "<3.0": 2 + }, + "血清球蛋白、γ球蛋白或免疫球蛋白/相应正常值比率": { + ">2.0": 3, + "1.5 - 2.0": 2, + "1.0 - 1.5": 1, + "<1.0": 0 + }, + "自身抗体(啮齿动物组织免疫荧光检测滴度)": { + "抗核抗体或抗肝肾微粒体抗体 >1:80 (儿童>1:20 )": 3, + "抗核抗体或抗肝肾微粒体抗体 1:80 (儿童1:10-1:20 )": 2, + "抗核抗体或抗肝肾微粒体抗体 1:40": 1, + "抗核抗体或抗肝肾微粒体抗体 <1:40 (儿童<1:10 )": 0, + "抗平滑肌抗体>1:80 (儿童>1:20 )": 3, + "抗平滑肌抗体1:80 (儿童1:20 )": 2, + "抗平滑肌抗体1:40": 1, + "抗平滑肌抗体<1:40 (儿童<1:20 )": 0, + "SLA、ASGP-R、LSP、LC1、LP、HHPM 或硫苷脂阳性": 2, + "抗线粒体抗体阳性": -2 + }, + "病毒标记物": { + "IgM (免疫球蛋白 M)抗-HAV(甲型肝炎病毒)、 HBsAg(乙型肝炎病毒表面抗原)或IgM 抗HBc": -3, + "通过ELISA (酶联免疫吸附测定)或 RIBA(重组免疫印迹试验)检测抗 HCV(丙型肝炎病毒) 抗体": -2, + "通过PCR(多元聚合酶链反应)/RNA(核糖核酸)检测抗 HCV (丙型肝炎病毒)抗体": -3, + "其他检测或活动性病毒感染": -3, + "病毒血清阴性": 3 + }, + "近期肝毒性药物接触史或血液制品非肠道接触史": { + "是": -2, + "否": 1 + }, + "饮酒量": { + "男<35 gm/天; 女<25 gm/天": 2, + "男 35-35 gm/天; 女 25-40 gm/天": 0, + "男 50-80 gm/天; 女 40-60 gm/天": -2, + "男 >80 gm/天; 女 >60 gm/天": -1 + }, + "基因因素": { + "患者或其直系亲属中存在其他自身免疫性疾病": 1, + "HLA(人类白细胞抗原) B8-DR3 单体型或 DR4 同种异型": 1 + }, + "组织学表现": { + "慢性活动性肝炎 / 碎片性坏死/ 小叶侵犯 / 桥接坏死": 3, + "同样无小叶侵犯或桥接坏死": 2, + "花环状": 1, + "血浆细胞显著浸润": 1, + "胆汁变化": -1, + "肉芽肿/铁尘肺/铜/其他改变提示不同病原学": -3 + }, + "治疗效果": { + "完全有效": 2, + "部分有效或无效": 0, + "根据疾病活动度,无效": -2, + "首次完全有效后停止治疗期间或之后复发": 3 + } + }, + "rating interpretation": "治疗前 AIH 预测\n16 - 25 分数:\t确诊自身免疫性肝炎\n10 - 15 分数:\t疑似 AIH\n0 - 9 分数:\tAIH 几率较小\n治疗后 AIH 预测\n18 - 25 分数:\t确诊自身免疫性肝炎\n12 - 17 分数:\t疑似 AIH\n0 - 11 分数:\tAIH 几率较小", + "remarks": "" + }, + "GLASGOW昏迷评分": { + "id": 196, + "category": "损伤;中毒", + "name": "GLASGOW昏迷评分", + "points": { + "睁眼": { + "自发": 4, + "对口头命令": 3, + "对疼痛": 2, + "无": 1 + }, + "最佳活动反应": { + "遵从口头命令": 6, + "定位疼痛刺激": 5, + "对疼痛刺激的弯曲收缩": 4, + "对疼痛刺激的去皮质反应": 3, + "对疼痛刺激的去大脑反应": 2, + "无": 1 + }, + "最佳语言反应": { + "交谈正常": 5, + "交谈异常": 4, + "用词不当": 3, + "用词无法理解": 3, + "声音无法理解": 2, + "无": 1 + } + }, + "rating interpretation": "15 分数:\t正常\n3 - 14 分数:\t异常", + "remarks": "" + }, + "老年抑郁量表": { + "id": 108, + "category": "老年医学", + "name": "老年抑郁量表", + "points": { + "您是否对生活基本满意?": { + "是": 0, + "否": 1 + }, + "您是否停止较多活动及兴趣?": { + "是": 1, + "否": 0 + }, + "您是否感到人生空虚?": { + "是": 1, + "否": 0 + }, + "您是否经常感到无聊?": { + "是": 1, + "否": 0 + }, + "您是否大多数时间精神较好?": { + "是": 0, + "否": 1 + }, + "您是否担心会有坏事要发生?": { + "是": 1, + "否": 0 + }, + "您是否大多数时间心情愉悦?": { + "是": 0, + "否": 1 + }, + "您是否经常感到无助?": { + "是": 1, + "否": 0 + }, + "您是否更喜欢呆在家里,而非外出或做些新事物?": { + "是": 1, + "否": 0 + }, + "您是否感到自己比大多数人有更多记忆方面的问题?": { + "是": 1, + "否": 0 + }, + "您是否认为现在活着很美好?": { + "是": 0, + "否": 1 + }, + "您是否感觉到您现在非常无用?": { + "是": 1, + "否": 0 + }, + "您是否感到精力充肺?": { + "是": 0, + "否": 1 + }, + "您是否感到处境无望?": { + "是": 1, + "否": 0 + }, + "您是否认为大多人比你都富有?": { + "是": 1, + "否": 0 + } + }, + "rating interpretation": "10 - 15 分数:\t疑似有抑郁\n6 - 9 分数:\t可能有抑郁\n0 - 5 分数:\t不可能有抑郁", + "remarks": "" + }, + "前列腺疾病症状评分": { + "id": 125, + "category": "泌尿生殖系统疾病", + "name": "前列腺疾病症状评分", + "points": { + "过去的一个月里,您是否有尿不尽的感觉?": { + "无": 0, + "低于每五次中有一次": 1, + "低于每两次中有一次": 2, + "大约每两次中有一次": 3, + "高于每两次中有一次": 4, + "总是": 5 + }, + "过去的一个月里,您是否需要在2个小时内多次去卫生间?": { + "无": 0, + "低于每五次中有一次": 1, + "低于每两次中有一次": 2, + "大约每两次中有一次": 3, + "高于每两次中有一次": 4, + "总是": 5 + }, + "过去的一个月里,您是否会有排尿中断?": { + "无": 0, + "低于每五次中有一次": 1, + "低于每两次中有一次": 2, + "大约每两次中有一次": 3, + "高于每两次中有一次": 4, + "总是": 5 + }, + "过去的一个月里,您是否有控尿困难?": { + "无": 0, + "低于每五次中有一次": 1, + "低于每两次中有一次": 2, + "大约每两次中有一次": 3, + "高于每两次中有一次": 4, + "总是": 5 + }, + "过去的一个月里,您是否有排尿无力的情况?": { + "无": 0, + "低于每五次中有一次": 1, + "低于每两次中有一次": 2, + "大约每两次中有一次": 3, + "高于每两次中有一次": 4, + "总是": 5 + }, + "过去的一个月里,您是否需要用力来促使排尿?": { + "无": 0, + "低于每五次中有一次": 1, + "低于每两次中有一次": 2, + "大约每两次中有一次": 3, + "高于每两次中有一次": 4, + "总是": 5 + }, + "过去的一个月里,睡觉后您平均起床排尿的次数是多少?": { + "无": 0, + "一次": 1, + "两次": 2, + "三次": 3, + "四次": 4, + "五次或以上": 5 + } + }, + "rating interpretation": "0 - 7 分数:\t轻微症状\n8 - 19 分数:\t中度症状\n20 - 35 分数:\t严重症状", + "remarks": "" + }, + "NIH 卒中评分": { + "id": 190, + "category": "神经系统疾病", + "name": "NIH 卒中评分", + "points": { + "意识水平": { + "反应敏锐": 0, + "不灵敏,最小刺激可唤醒": 1, + "不灵敏,需要反复刺激": 2, + "昏迷": 3 + }, + "患者知道月份和自己的年龄": { + "回答都正确": 0, + "正确回答一个": 1, + "两个回答都不正确": 2 + }, + "患者按照指令睁眼闭眼": { + "两个动作都完成正确": 0, + "正确完成一个动作": 1, + "两个都不能正确完成": 2 + }, + "凝视(仅测试水平眼球运动)": { + "正常": 0, + "部分凝视麻痹": 1, + "被动偏差": 2 + }, + "视野检测": { + "无视野缺失": 0, + "部分偏盲": 1, + "完全偏盲": 2, + "双侧偏盲(全盲,包括皮质盲)": 3 + }, + "面瘫(要求患者示齿、扬眉和闭眼)": { + "正常对称动作": 0, + "轻微瘫痪": 1, + "部分瘫痪(下面部完全或几乎完全瘫痪)": 2, + "一侧或两侧完全瘫痪": 3 + }, + "右臂运动功能": { + "正常": 0, + "移动": 1, + "能对抗一些重力": 2, + "不能对抗重力": 3, + "无运动": 4, + "无法检测*": 0 + }, + "右腿运动功能": { + "正常": 0, + "移动": 1, + "能对抗一些重力": 2, + "不能对抗重力": 3, + "无运动": 4, + "无法检测*": 0 + }, + "左腿运动功能": { + "正常": 0, + "移动": 1, + "能对抗一些重力": 2, + "不能对抗重力": 3, + "无运动": 4, + "无法检测*": 0 + }, + "共济失调": { + "无": 0, + "一侧肢体": 1, + "两侧肢体": 2 + }, + "针尖刺激测感觉": { + "正常": 0, + "轻到中度感觉下降": 1, + "严重到完全感觉缺失": 2 + }, + "语言": { + "无失语": 0, + "轻到中度失语": 1, + "严重失语": 2, + "完全失语": 3 + }, + "构音障碍": { + "无": 0, + "轻到中度发音不清": 1, + "严重": 2, + "插管或其他经检测身体障碍": 0 + }, + "消失和忽视": { + "正常": 0, + "对任何一种感觉形式双侧刺激的忽视或消失": 1, + "严重半侧注意缺失或对超过一种形式的半侧注意缺失": 2 + } + }, + "rating interpretation": "NIH 脑卒中评分>22 具有重要意义,可预测并发症风险增加。\n评分通常用来追踪脑卒中后果、改善或恶化。", + "remarks": "*若由于截肢或其他限制无法检测上肢或下肢的,记录为无法检测,不计入得分。" + }, + "CIWA-Ar的临床研究所的戒断反应评估量表": { + "id": 204, + "category": "特殊问题", + "name": "CIWA-Ar的临床研究所的戒断反应评估量表", + "points": { + "恶心和呕吐 问“是否感到胃部不适? 是否有呕吐?” 观察。": { + "无恶心及呕吐": 0, + "轻度恶心但无呕吐": 1, + "阵发性恶心伴干呕": 4, + "持续性恶心、频繁干呕及呕吐": 7 + }, + "震颤:伸臂、手指展开。观察。": { + "无震颤": 0, + "不明显,但指尖可感受到": 1, + "中度,患者手臂展开时震颤": 4, + "重度,手臂不展开时也有震颤": 7 + }, + "阵发性盗汗:观察。": { + "无盗汗": 0, + "盗汗不明显、手掌湿": 1, + "额头明显汗珠": 4, + "大汗淋漓": 7 + }, + "焦虑:问“你感到焦虑吗?” 观察。": { + "不焦虑、轻松自在": 0, + "轻度焦虑": 1, + "中度焦虑、或防备心理,因此推断焦虑": 4, + "相当于严重谵妄中所见的急性恐慌状态,或急性精神分裂症反应": 7 + }, + "激动:观察。": { + "正常活动": 0, + "比正常活动稍微亢奋": 1, + "中度烦躁和坐立不安": 4, + "访谈大部分时间踱来踱去或烦躁不安的走来走去": 7 + }, + "触觉障碍:问“您有任何瘙痒、针刺感、灼热感、麻木吗?或您是否感到皮肤表面或里面有虫在爬?” 观察。": { + "无": 0, + "非常轻微瘙痒、针刺感、灼热或麻木": 1, + "轻微瘙痒、针刺感、灼热或麻木": 2, + "中度瘙痒、针刺感、灼热或麻木": 3, + "中度严重幻觉": 4, + "严重幻觉": 5, + "非常严重的幻觉": 6, + "持续性幻觉": 7 + }, + "听觉障碍:问“你是否对周围声音变得更加敏感? 声音很刺耳吗? 吓到你了吗? 你是否听到令你不安的声音? 你是否听到了你明知不存在的声音? 观察。": { + "不存在": 0, + "非常轻微的刺耳声或受惊吓": 1, + "轻微的刺耳声或受惊吓": 2, + "中度的刺耳声或受惊吓": 3, + "中度严重幻觉": 4, + "严重幻觉": 5, + "非常严重的幻觉": 6, + "持续性幻觉": 7 + }, + "视力障碍:问“光线是否显得过于明亮? 颜色是否有所不同? 是否使你感到眼痛? 是否看到任何令你不安的东西? 是否看到任何你明知不存在的东西?” 观察。": { + "不存在": 0, + "非常轻微的敏感度": 1, + "轻微的敏感度": 2, + "中度的敏感度": 3, + "中度严重幻觉": 4, + "严重幻觉": 5, + "非常严重的幻觉": 6, + "持续性幻觉": 7 + }, + "头痛、头胀:问“你是否感到头部异常? 是否感到好像有橡圈箍着头部?” 不评级头昏或头晕。否则,评级为严重。": { + "不存在": 0, + "非常轻微": 1, + "轻微": 2, + "中度": 3, + "中度严重": 4, + "严重": 5, + "很严重": 6, + "非常严重": 7 + }, + "定位力和感觉模糊:问“今天几号了? 你在哪里? 我是谁?” 从一数到三。": { + "定位力好且可做系列加法": 0, + "不能进行系列加法或不确定日期": 1, + "日期定位出入不超过两个公历日": 2, + "日期定位出入超过两个公历日": 3, + "地点和/或人定位错误": 4 + } + }, + "rating interpretation": "0 - 9 分数:\t非常轻微戒断\n10 - 15 分数:\t轻微戒断\n16 - 20 分数:\t中度戒断\n21 - 67 分数:\t重度戒断", + "remarks": "" + }, + "饮酒筛查问卷调查": { + "id": 247, + "category": "特殊问题", + "name": "饮酒筛查问卷调查", + "points": { + "1) 您多久饮用一次含酒精的饮品?": { + "从不": 0, + "每月 1 次或更少": 1, + "每月 2-4 次": 2, + "每周 2-3 次": 3, + "每周 4 次或以上": 4 + }, + "2) 通常一天中您会饮用多少杯含酒精的饮品?": { + "1 杯或 2 杯": 0, + "3 杯或 4 杯": 1, + "5 杯或 6 杯": 2, + "7 杯至 9 杯": 3, + "10 杯或更多": 4 + }, + "3) 一次饮 5 杯或以上的情况会多久出现一次?": { + "从不": 0, + "少于每月 1 次": 1, + "每月 1 次": 2, + "每周 1 次": 3, + "每天或几乎每天": 4 + }, + "4) 在去年,您开始饮酒后便无法停止的情况多久出现一次?": { + "从不": 0, + "少于每月 1 次": 1, + "每月 1 次": 2, + "每周 1 次": 3, + "每天或几乎每天": 4 + }, + "5) 在去年,您由于饮酒而无法完成正常预期的事情的情况多久出现一次?": { + "从不": 0, + "少于每月 1 次": 1, + "每月 1 次": 2, + "每周 1 次": 3, + "每天或几乎每天": 4 + }, + "6) 在去年,当您在晚上大量饮酒后,次日早上需要再饮一杯才能正常做事情的情况多久出现一次?": { + "从不": 0, + "少于每月 1 次": 1, + "每月 1 次": 2, + "每周 1 次": 3, + "每天或几乎每天": 4 + }, + "7) 在去年,您在饮酒后感觉内疚或懊悔的情况多久出现一次?": { + "从不": 0, + "少于每月 1 次": 1, + "每月 1 次": 2, + "每周 1 次": 3, + "每天或几乎每天": 4 + }, + "8) 在去年,您由于饮酒而不记得前一晚发生的事情的情况多久出现一次?": { + "从不": 0, + "少于每月 1 次": 1, + "每月 1 次": 2, + "每周 1 次": 3, + "每天或几乎每天": 4 + }, + "9) 您或他人是否曾经因为您饮酒而受伤?": { + "否": 0, + "是,但不是在去年": 2, + "是,在去年": 4 + }, + "10) 是否有亲戚、朋友或医护人员曾经为您的饮酒问题感到担忧,或者建议您减少饮酒?": { + "否": 0, + "是,但不是在去年": 2, + "是,在去年": 4 + } + }, + "rating interpretation": "0 - 7 分值:\t低风险\n8 - 15 分值:\t中等风险\n16 - 19 分值:\t高风险\n20 - 40 分值:\t有可能成瘾", + "remarks": "" + }, + "克罗恩病活动指数(CDAI)": { + "id": 251, + "category": "消化道疾病", + "name": "克罗恩病活动指数(CDAI)", + "points": { + "患者报告了大便模式": { + "七天内每天平均水样便或软便次数": 14, + "使用地芬诺酯和洛哌丁胺治疗腹泻": 30 + }, + "七天内的平均腹痛评分": { + "无": 0, + "轻度疼痛": 35, + "中度疼痛": 70, + "重度疼痛": 105 + }, + "七天内每天的健康状况": { + "好": 0, + "略低于平均水平": 49, + "差": 98, + "非常差": 147, + "糟糕": 196 + }, + "并发症": { + "关节炎或关节痛": 20, + "虹膜炎或葡萄膜炎": 20, + "结节性红斑、坏疽性脓皮病或阿弗他性口腔黏膜炎": 20, + "肛裂、瘘管或脓肿": 20, + "其他瘘管": 20, + "上周温度超过 100 华氏度(37.8 摄氏度)": 20 + }, + "发现腹部肿块": { + "无肿块": 0, + "可能的肿块": 20, + "确定的肿块": 50 + }, + "贫血和体重变化": { + "血细胞比容的绝对偏差:男性为 47%,女性为 42%": 6, + "与标准体重的百分比偏差": 1 + } + }, + "rating interpretation": "0 - 149 分值:\t无症状缓解\n150 - 220 分值:\t轻度至中度活动性克罗恩氏病\n221 - 450 分值:\t中度至重度活动性克罗恩氏病\n451 - 1100 分值:\t重度活动性至爆发性疾病", + "remarks": "" + }, + "EuroSCORE评分心脏手术风险评估(附加版)": { + "id": 252, + "category": "心血管疾病", + "name": "EuroSCORE评分心脏手术风险评估(附加版)", + "points": { + "年龄": { + "<60": 0 + }, + "性别": { + "女性": 1, + "男性": 0 + }, + "射血分数": { + "30-50%": 1, + "<30%": 3, + "肾功能不全": 2, + "外周血管病": 2, + "呼吸系统病变": 1, + "脑血管疾病": 2, + "先前的心脏手术": 3, + "活动性心内膜炎": 3, + "关键的术前状态": 3, + "不稳定型心绞痛": 2, + "最近的心肌梗死": 2, + "肺动脉高压": 2, + "紧急手术": 2, + "除了孤立的冠状动脉搭桥术": 2, + "室间隔破裂": 4, + "胸主动脉手术": 3 + } + }, + "rating interpretation": "0 - 2 分值:\t低风险\n3 - 5 分值:\t中风险\n6 - 45 分值:\t高风险", + "remarks": "" + }, + "ST段抬高型心肌梗死溶栓(TIMI)评分": { + "id": 259, + "category": "心血管疾病", + "name": "ST段抬高型心肌梗死溶栓(TIMI)评分", + "points": { + "年龄": { + "75 周岁及以上": 3, + "65-74 周岁": 2, + "65 周岁以下": 0 + } + }, + "rating interpretation": "0 分数:\t0.8%\n1 分数:\t1.6%\n2 分数:\t2.2%\n3 分数:\t4.4%\n4 分数:\t7.3%\n5 分数:\t12%\n6 分数:\t16%\n7 分数:\t23%\n8 分数:\t27%\n9 - 14 分数:\t36%", + "remarks": "" + }, + "房颤中风危险的CHA(2)DS(2)-VASc评分": { + "id": 274, + "category": "心血管疾病", + "name": "房颤中风危险的CHA(2)DS(2)-VASc评分", + "points": { + "临床特点": { + "充血性心衰/ LV 功能障碍": 1, + "高血压": 1, + "糖尿病": 1, + "中风、短暂性脑缺血 (TIA) 或血栓栓塞病史": 2, + "血管疾病(心肌梗死 [MI]、外周血管疾病 [PVD] 或主动脉粥样硬化病史)": 1 + }, + "年龄": { + "65-74 岁": 1, + "≥75 岁": 2 + }, + "性别": { + "女": 1, + "男": 0 + } + }, + "rating interpretation": "0 分值:\t每年 0%\n1 分值:\t每年 1.3%\n2 分值:\t每年 2.2%\n3 分值:\t每年 3.2%\n4 分值:\t每年 4%\n5 分值:\t每年 6.7%\n6 分值:\t每年 9.8%\n7 分值:\t每年 9.6%\n8 分值:\t每年 6.7%\n9 分值:\t每年 15.2%", + "remarks": "" + }, + "肝素诱导的血小板减少(4-T分数)的验前概率": { + "id": 283, + "category": "血液病学及肿瘤病学", + "name": "肝素诱导的血小板减少(4-T分数)的验前概率", + "points": { + "血小板减少": { + "血小板计数>下降 50%且最低为≥20,000/microL": 2, + "血小板计数下降 30%-50%或最低为 10,000-19,000 /microL": 1, + "血小板计数下降<30%或最低为 <10,000/microL": 0 + }, + "血小板计数下降时间": { + "肝素接触 5 到 10 天有明显症状,或 若既往 30 天以内接触过肝素,≤第一天一天血小板计数下降": 2, + "同 5-10 天血小板计数下降一致,但不明确(例如,血小板计数缺失), 或10 天后发病,或既往 30-100 天内接触过肝素,≤第一天下降": 1, + "若无肝素接触,血小板计数在第<4日下降": 0 + }, + "血栓形成或其他后遗症": { + "确诊新发血栓、皮肤坏死或急性系统性反应 发生在静脉注射普通肝素丸之后": 2, + "进行性或复发性血栓、非坏死性(红斑的)皮肤病变或疑似 血栓(未经证明)": 1, + "无": 0 + }, + "血小板下降其他原因": { + "不明显": 2, + "可能": 1, + "明确的": 0 + } + }, + "rating interpretation": "0 - 3 分数:\t低概率\n4 - 5 分数:\t中等概率\n6 - 8 分数:\t高概率", + "remarks": "" + } + }, + "indicator": { + "体重": { + "id": 1, + "unit": "kg", + "type": "float", + "range": [ + 20.0, + 150.0 + ], + "precision": 2 + }, + "心率": { + "id": 2, + "unit": "bpm", + "type": "int", + "range": [ + 40.0, + 200.0 + ], + "precision": 0 + }, + "QT间期": { + "id": 3, + "unit": "sec", + "type": "float", + "range": [ + 0.3, + 0.5 + ], + "precision": 2 + }, + "校正QT间期": { + "id": 4, + "unit": "sec", + "type": "float", + "range": [ + 0.32, + 0.44 + ], + "precision": 2 + }, + "身高": { + "id": 5, + "unit": "m", + "type": "float", + "range": [ + 0.5, + 2.5 + ], + "precision": 2 + }, + "钠缺乏": { + "id": 7, + "unit": "mEq", + "type": "float", + "range": [ + 0.0, + 200.0 + ], + "precision": 0 + }, + "正常体重": { + "id": 8, + "unit": "kg", + "type": "float", + "range": [ + 45.0, + 75.0 + ], + "precision": 1 + }, + "测量血清钠": { + "id": 9, + "unit": "mEq/L", + "type": "float", + "range": [ + 120.0, + 160.0 + ], + "precision": 2 + }, + "目标血清钠": { + "id": 10, + "unit": "mEq/L", + "type": "float", + "range": [ + 135.0, + 145.0 + ], + "precision": 2 + }, + "补液速率": { + "id": 11, + "unit": "mL/hr", + "type": "float", + "range": [ + 50.0, + 500.0 + ], + "precision": 2 + }, + "血清钠变化每小时": { + "id": 12, + "unit": "mEq/L/hr", + "type": "float", + "range": [ + -5.0, + 5.0 + ], + "precision": 2 + }, + "血清钠": { + "id": 13, + "unit": "mEq/L", + "type": "float", + "range": [ + 120.0, + 160.0 + ], + "precision": 2 + }, + "静脉注射钾": { + "id": 16, + "unit": "mEq/L", + "type": "float", + "range": [ + 0.0, + 40.0 + ], + "precision": 2 + }, + "血清钠变化每升": { + "id": 17, + "unit": "mEq/L", + "type": "float", + "range": [ + -10.0, + 10.0 + ], + "precision": 2 + }, + "体表面积": { + "id": 18, + "unit": "m^2", + "type": "float", + "range": [ + 0.5, + 2.5 + ], + "precision": 2 + }, + "身体质量指数": { + "id": 19, + "unit": "kg/m^2", + "type": "float", + "range": [ + 10.0, + 50.0 + ], + "precision": 2 + }, + "转铁蛋白饱和度": { + "id": 20, + "unit": "%", + "type": "float", + "range": [ + 15.0, + 50.0 + ], + "precision": 2 + }, + "血清铁": { + "id": 21, + "unit": "mcg/dL", + "type": "float", + "range": [ + 30.0, + 300.0 + ], + "precision": 2 + }, + "总铁结合力": { + "id": 22, + "unit": "mcg/dL", + "type": "float", + "range": [ + 200.0, + 400.0 + ], + "precision": 2 + }, + "阴离子间隙": { + "id": 23, + "unit": "mEq/L", + "type": "float", + "range": [ + 8.0, + 16.0 + ], + "precision": 2 + }, + "Na": { + "id": 24, + "unit": "mEq/L", + "type": "float", + "range": [ + 120.0, + 160.0 + ], + "precision": 2 + }, + "Cl": { + "id": 25, + "unit": "mEq/L", + "type": "float", + "range": [ + 90.0, + 110.0 + ], + "precision": 2 + }, + "HCO3": { + "id": 26, + "unit": "mEq/L", + "type": "float", + "range": [ + 22.0, + 30.0 + ], + "precision": 2 + }, + "期望AaG": { + "id": 27, + "unit": "mmHg", + "type": "float", + "range": [ + 5.0, + 20.0 + ], + "precision": 1 + }, + "年龄": { + "id": 28, + "unit": "year", + "type": "int", + "range": [ + 0.0, + 120.0 + ], + "precision": 0 + }, + "肾小球滤过率": { + "id": 29, + "unit": "mL/分钟/1.73 m^2", + "type": "float", + "range": [ + 30.0, + 150.0 + ], + "precision": 2 + }, + "血清肌酐": { + "id": 30, + "unit": "mg/dL", + "type": "float", + "range": [ + 0.6, + 1.5 + ], + "precision": 2 + }, + "血尿素氮": { + "id": 32, + "unit": "mg/dL", + "type": "float", + "range": [ + 6.0, + 20.0 + ], + "precision": 2 + }, + "白蛋白": { + "id": 33, + "unit": "gm/dL", + "type": "float", + "range": [ + 3.5, + 5.0 + ], + "precision": 2 + }, + "胆红素": { + "id": 34, + "unit": "mg/dL", + "type": "float", + "range": [ + 0.1, + 1.2 + ], + "precision": 2 + }, + "肌酐清除率": { + "id": 35, + "unit": "mL/sec", + "type": "float", + "range": [ + 0.5, + 2.5 + ], + "precision": 2 + }, + "钠": { + "id": 36, + "unit": "mEq/L", + "type": "float", + "range": [ + 120.0, + 160.0 + ], + "precision": 2 + }, + "氯": { + "id": 37, + "unit": "mEq/L", + "type": "float", + "range": [ + 90.0, + 110.0 + ], + "precision": 2 + }, + "碳酸氢根": { + "id": 38, + "unit": "mEq/L", + "type": "float", + "range": [ + 22.0, + 30.0 + ], + "precision": 2 + }, + "血肌酐浓度": { + "id": 39, + "unit": "mg/dL", + "type": "float", + "range": [ + 0.6, + 1.5 + ], + "precision": 2 + }, + "平均血管压力": { + "id": 40, + "unit": "mmHg", + "type": "float", + "range": [ + 60.0, + 100.0 + ], + "precision": 2 + }, + "收缩压": { + "id": 41, + "unit": "mmHg", + "type": "float", + "range": [ + 90.0, + 140.0 + ], + "precision": 2 + }, + "舒张压": { + "id": 42, + "unit": "mmHg", + "type": "float", + "range": [ + 60.0, + 90.0 + ], + "precision": 2 + }, + "百分比气胸": { + "id": 43, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 2 + }, + "肺直径": { + "id": 44, + "unit": "cm", + "type": "float", + "range": [ + 10.0, + 30.0 + ], + "precision": 2 + }, + "半胸直径": { + "id": 45, + "unit": "cm", + "type": "float", + "range": [ + 5.0, + 15.0 + ], + "precision": 2 + }, + "CaO2": { + "id": 46, + "unit": "mL/L", + "type": "float", + "range": [ + 150.0, + 220.0 + ], + "precision": 2 + }, + "Hgb": { + "id": 47, + "unit": "gm/dL", + "type": "float", + "range": [ + 12.0, + 16.0 + ], + "precision": 2 + }, + "O2Sat": { + "id": 48, + "unit": "%", + "type": "float", + "range": [ + 85.0, + 100.0 + ], + "precision": 2 + }, + "PaO2": { + "id": 49, + "unit": "mmHg", + "type": "float", + "range": [ + 60.0, + 100.0 + ], + "precision": 2 + }, + "paO2": { + "id": 50, + "unit": "mmHg", + "type": "float", + "range": [ + 60.0, + 100.0 + ], + "precision": 2 + }, + "心脏指数": { + "id": 51, + "unit": "index", + "type": "float", + "range": [ + 2.5, + 4.0 + ], + "precision": 2 + }, + "每搏输出量指数": { + "id": 52, + "unit": "mL/sqm", + "type": "float", + "range": [ + 30.0, + 70.0 + ], + "precision": 2 + }, + "耗氧量": { + "id": 53, + "unit": "mL/min", + "type": "float", + "range": [ + 100.0, + 300.0 + ], + "precision": 2 + }, + "心输出量": { + "id": 54, + "unit": "L/min", + "type": "float", + "range": [ + 4.0, + 8.0 + ], + "precision": 2 + }, + "每搏输出量": { + "id": 55, + "unit": "mL", + "type": "float", + "range": [ + 50.0, + 120.0 + ], + "precision": 2 + }, + "动脉氧含量": { + "id": 56, + "unit": "mL/min", + "type": "float", + "range": [ + 150.0, + 220.0 + ], + "precision": 2 + }, + "静脉氧含量": { + "id": 57, + "unit": "mL/min", + "type": "float", + "range": [ + 110.0, + 160.0 + ], + "precision": 2 + }, + "MELD评分": { + "id": 58, + "unit": "", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "肌酐": { + "id": 59, + "unit": "mg/dL", + "type": "float", + "range": [ + 1.0, + 4.0 + ], + "precision": 2 + }, + "国际标准化比率": { + "id": 60, + "unit": "", + "type": "float", + "range": [ + 1.0, + 100.0 + ], + "precision": 2 + }, + "MELDNa评分": { + "id": 61, + "unit": "", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "血液透析前尿素量": { + "id": 62, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 10.0, + 20.0 + ], + "precision": 1 + }, + "血液透析后尿素量": { + "id": 63, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 0.0, + 10.0 + ], + "precision": 1 + }, + "尿素减少百分比": { + "id": 64, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 1 + }, + "基线间隙": { + "id": 65, + "unit": "mmol/L", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 1 + }, + "Delta间隙": { + "id": 66, + "unit": "mmol/L", + "type": "float", + "range": [ + -100.0, + 100.0 + ], + "precision": 1 + }, + "白细胞计数": { + "id": 67, + "unit": "*10^9/L", + "type": "float", + "range": [ + 0.0, + 15.0 + ], + "precision": 1 + }, + "分叶核粒细胞百分比": { + "id": 68, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 1 + }, + "杆状核粒细胞百分比": { + "id": 69, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 1 + }, + "绝对嗜中性粒细胞计数": { + "id": 70, + "unit": "*10^9/L", + "type": "float", + "range": [ + 0.0, + 10.0 + ], + "precision": 1 + }, + "患者体温": { + "id": 71, + "unit": "℃", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 1 + }, + "海拔": { + "id": 72, + "unit": "m", + "type": "int", + "range": [ + 0.0, + 10000.0 + ], + "precision": 0 + }, + "吸入氧百分数": { + "id": 73, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 1 + }, + "PCO2": { + "id": 74, + "unit": "mmHg 或 kPa", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 1 + }, + "pCO2": { + "id": 75, + "unit": "mmHg 或 kPa", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 1 + }, + "呼吸交换率": { + "id": 76, + "unit": "", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 1 + }, + "实测AaG": { + "id": 77, + "unit": "mmHg 或 kPa", + "type": "float", + "range": [ + 0.0, + 20.0 + ], + "precision": 1 + }, + "PaCO2": { + "id": 78, + "unit": "mmHg 或 kPa", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 1 + }, + "pH": { + "id": 79, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 14.0 + ], + "precision": 1 + }, + "RR间期": { + "id": 80, + "unit": "ms(毫秒)", + "type": "int", + "range": [ + 600.0, + 1000.0 + ], + "precision": 0 + }, + "测量血清钙": { + "id": 81, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 2.1, + 2.6 + ], + "precision": 1 + }, + "正常血清白蛋白": { + "id": 82, + "unit": "g/L", + "type": "int", + "range": [ + 40.0, + 55.0 + ], + "precision": 0 + }, + "患者血清白蛋白": { + "id": 83, + "unit": "g/L", + "type": "int", + "range": [ + 35.0, + 50.0 + ], + "precision": 0 + }, + "校正血清钙": { + "id": 84, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 2.1, + 2.6 + ], + "precision": 1 + }, + "每日液体量": { + "id": 85, + "unit": "mL或L", + "type": "int", + "range": [ + 1500.0, + 3000.0 + ], + "precision": 0 + }, + "液体速率": { + "id": 86, + "unit": "mL/h", + "type": "float", + "range": [ + 60.0, + 125.0 + ], + "precision": 1 + }, + "总体液量": { + "id": 87, + "unit": "L", + "type": "float", + "range": [ + 30.0, + 50.0 + ], + "precision": 1 + }, + "钾": { + "id": 88, + "unit": "mmol/L", + "type": "float", + "range": [ + 3.5, + 5.0 + ], + "precision": 1 + }, + "尿液阴离子间隙": { + "id": 89, + "unit": "mmol/L", + "type": "float", + "range": [ + -20.0, + 20.0 + ], + "precision": 1 + }, + "甘油三酯": { + "id": 90, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 0.4, + 1.7 + ], + "precision": 1 + }, + "极低密度脂蛋白": { + "id": 91, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 0.2, + 0.7 + ], + "precision": 1 + }, + "葡萄糖": { + "id": 92, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 3.9, + 6.1 + ], + "precision": 1 + }, + "渗透压度": { + "id": 93, + "unit": "mOsm/kg·H₂O", + "type": "float", + "range": [ + 280.0, + 300.0 + ], + "precision": 1 + }, + "身体质量指数(BMI)": { + "id": 94, + "unit": "kg/m²", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 1 + }, + "LDL": { + "id": 95, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 1.0, + 3.4 + ], + "precision": 1 + }, + "总胆固醇": { + "id": 96, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 3.1, + 5.2 + ], + "precision": 1 + }, + "HDL": { + "id": 97, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 1.0, + 1.6 + ], + "precision": 1 + }, + "Na变化": { + "id": 98, + "unit": "mmol/L", + "type": "float", + "range": [ + -20.0, + 20.0 + ], + "precision": 1 + }, + "血清蛋白": { + "id": 99, + "unit": "g/L", + "type": "float", + "range": [ + 60.0, + 80.0 + ], + "precision": 1 + }, + "钠变化": { + "id": 100, + "unit": "mmol/L", + "type": "float", + "range": [ + -20.0, + 20.0 + ], + "precision": 1 + }, + "血糖": { + "id": 101, + "unit": "mmol/L 或 mg/dL", + "type": "float", + "range": [ + 3.9, + 6.1 + ], + "precision": 1 + }, + "校正血清钠": { + "id": 102, + "unit": "mmol/L", + "type": "float", + "range": [ + 135.0, + 145.0 + ], + "precision": 1 + }, + "年龄性别系数": { + "id": 103, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "测量血钠浓度": { + "id": 104, + "unit": "mmol/L", + "type": "float", + "range": [ + 135.0, + 145.0 + ], + "precision": 1 + }, + "目标血钠浓度": { + "id": 105, + "unit": "mmol/L", + "type": "float", + "range": [ + 135.0, + 145.0 + ], + "precision": 1 + }, + "水缺乏": { + "id": 106, + "unit": "mL/kg", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 1 + }, + "白细胞脑脊液": { + "id": 107, + "unit": "×10⁶/L", + "type": "int", + "range": [ + 0.0, + 5.0 + ], + "precision": 0 + }, + "白细胞血液": { + "id": 108, + "unit": "×10⁹/L", + "type": "float", + "range": [ + 4.0, + 10.0 + ], + "precision": 1 + }, + "红细胞脑脊液": { + "id": 109, + "unit": "×10⁶/L", + "type": "int", + "range": [ + 0.0, + 5.0 + ], + "precision": 0 + }, + "红细胞血液": { + "id": 110, + "unit": "×10¹²/L", + "type": "float", + "range": [ + 3.5, + 5.9 + ], + "precision": 1 + }, + "蛋白质脑脊液": { + "id": 111, + "unit": "g/L 或 mg/dL", + "type": "float", + "range": [ + 0.15, + 0.45 + ], + "precision": 1 + }, + "蛋白质血清": { + "id": 112, + "unit": "g/L", + "type": "int", + "range": [ + 60.0, + 80.0 + ], + "precision": 0 + }, + "红细胞比容": { + "id": 113, + "unit": "%", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "蛋白质": { + "id": 114, + "unit": "g/L", + "type": "int", + "range": [ + 60.0, + 80.0 + ], + "precision": 0 + }, + "非体表烧伤面积百分位数": { + "id": 115, + "unit": "%", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "第一个24小时晶体液总量": { + "id": 116, + "unit": "mL/L", + "type": "int", + "range": [ + 1000.0, + 5000.0 + ], + "precision": 0 + }, + "第一个8小时率": { + "id": 117, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 1 + }, + "之后16小时率": { + "id": 118, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 1 + }, + "敏感性": { + "id": 119, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 3 + }, + "特异性": { + "id": 120, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 3 + }, + "阳性似然比": { + "id": 121, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "阴性似然比": { + "id": 122, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "真阳性": { + "id": 123, + "unit": "无单位", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "假阴性": { + "id": 124, + "unit": "无单位", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "假阳性": { + "id": 125, + "unit": "无单位", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "阳性预测值": { + "id": 126, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 3 + }, + "真阴性": { + "id": 127, + "unit": "无单位", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "阴性预测值": { + "id": 128, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 3 + }, + "可能性": { + "id": 129, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 3 + }, + "几率": { + "id": 130, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "流行性": { + "id": 131, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 4 + }, + "PPV": { + "id": 132, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 4 + }, + "NPV": { + "id": 133, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 4 + }, + "患病率": { + "id": 134, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "验前比": { + "id": 135, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "假阴性率": { + "id": 136, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 5.0 + ], + "precision": 1 + }, + "假阳性率": { + "id": 137, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 10.0 + ], + "precision": 1 + }, + "检验前几率比值比": { + "id": 138, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "检验后阳性率比值比": { + "id": 139, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "总体准确度": { + "id": 140, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "WBC": { + "id": 141, + "unit": "*10^9/L", + "type": "float", + "range": [ + 4.0, + 10.0 + ], + "precision": 1 + }, + "嗜酸性粒细胞": { + "id": 142, + "unit": "%", + "type": "float", + "range": [ + 0.5, + 5.0 + ], + "precision": 1 + }, + "嗜酸性粒细胞绝对计数": { + "id": 143, + "unit": "×10⁹/L", + "type": "float", + "range": [ + 0.05, + 0.5 + ], + "precision": 1 + }, + "淋巴细胞百分比": { + "id": 144, + "unit": "%", + "type": "float", + "range": [ + 20.0, + 40.0 + ], + "precision": 1 + }, + "绝对淋巴细胞计数": { + "id": 145, + "unit": "*10^9/L", + "type": "float", + "range": [ + 1.0, + 4.0 + ], + "precision": 1 + }, + "Hct": { + "id": 146, + "unit": "%", + "type": "float", + "range": [ + 35.0, + 45.0 + ], + "precision": 2 + }, + "网织红细胞计数": { + "id": 147, + "unit": "%", + "type": "float", + "range": [ + 0.5, + 1.5 + ], + "precision": 1 + }, + "RPI": { + "id": 148, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 2 + }, + "网织红细胞百分比": { + "id": 149, + "unit": "%", + "type": "float", + "range": [ + 0.5, + 1.5 + ], + "precision": 1 + }, + "血细胞比容": { + "id": 150, + "unit": "%", + "type": "float", + "range": [ + 35.0, + 45.0 + ], + "precision": 2 + }, + "绝对网织红细胞计数": { + "id": 151, + "unit": "×10¹²/L", + "type": "int", + "range": [ + 0.02, + 0.08 + ], + "precision": 0 + }, + "基础能量消耗女性": { + "id": 152, + "unit": "kJ", + "type": "int", + "range": [ + 6000.0, + 8000.0 + ], + "precision": 0 + }, + "基础能量消耗男性": { + "id": 153, + "unit": "kJ", + "type": "int", + "range": [ + 8000.0, + 10000.0 + ], + "precision": 0 + }, + "检验前机率比值比": { + "id": 154, + "unit": "无单位", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "Delta Delta 梯度": { + "id": 155, + "unit": "mmol/L", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 1 + }, + "白细胞": { + "id": 156, + "unit": "/mm^3", + "type": "int", + "range": [ + 4000.0, + 10000.0 + ], + "precision": 0 + }, + "理想体重": { + "id": 157, + "unit": "kg", + "type": "float", + "range": [ + 40.0, + 80.0 + ], + "precision": 2 + }, + "CI": { + "id": 158, + "unit": "mEq/L", + "type": "float", + "range": [ + 90.0, + 110.0 + ], + "precision": 2 + }, + "尿钠": { + "id": 159, + "unit": "mEq/L", + "type": "float", + "range": [ + 20.0, + 200.0 + ], + "precision": 2 + }, + "尿肌酐": { + "id": 160, + "unit": "mg/dL", + "type": "float", + "range": [ + 50.0, + 200.0 + ], + "precision": 2 + }, + "钠排泄分数": { + "id": 161, + "unit": "%", + "type": "float", + "range": [ + 0.1, + 3.0 + ], + "precision": 2 + }, + "动脉氧分压吸入氧浓度比率": { + "id": 162, + "unit": "ratio", + "type": "float", + "range": [ + 100.0, + 500.0 + ], + "precision": 2 + }, + "动脉氧分压": { + "id": 163, + "unit": "mmHg", + "type": "float", + "range": [ + 60.0, + 100.0 + ], + "precision": 2 + }, + "吸入氧浓度": { + "id": 164, + "unit": "fractionO2", + "type": "float", + "range": [ + 0.21, + 1.0 + ], + "precision": 2 + }, + "生存": { + "id": 165, + "unit": "ratio", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "创建": { + "id": 166, + "unit": "mg/dL", + "type": "float", + "range": [ + 0.0, + 1000.0 + ], + "precision": 2 + }, + "INR": { + "id": 167, + "unit": "ratio", + "type": "float", + "range": [ + 0.8, + 1.2 + ], + "precision": 2 + }, + "风险评分": { + "id": 168, + "unit": "score", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 2 + }, + "CDS": { + "id": 169, + "unit": "points", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 2 + }, + "Lok指数": { + "id": 170, + "unit": "fraction", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "GUCI": { + "id": 171, + "unit": "index", + "type": "float", + "range": [ + 0.0, + 100.0 + ], + "precision": 2 + }, + "APRI": { + "id": 172, + "unit": "index", + "type": "float", + "range": [ + 0.0, + 10.0 + ], + "precision": 2 + }, + "FIB4": { + "id": 173, + "unit": "index", + "type": "float", + "range": [ + 0.0, + 10.0 + ], + "precision": 2 + }, + "血小板": { + "id": 174, + "unit": "10^9/L", + "type": "float", + "range": [ + 50.0, + 500.0 + ], + "precision": 2 + }, + "ALT": { + "id": 175, + "unit": "U/L", + "type": "float", + "range": [ + 5.0, + 40.0 + ], + "precision": 2 + }, + "AST": { + "id": 176, + "unit": "U/L", + "type": "float", + "range": [ + 8.0, + 40.0 + ], + "precision": 2 + }, + "顶级正常值AST": { + "id": 177, + "unit": "U/L", + "type": "float", + "range": [ + 8.0, + 40.0 + ], + "precision": 2 + }, + "日志可能性Lok": { + "id": 178, + "unit": "", + "type": "float", + "range": [ + -10.0, + 10.0 + ], + "precision": 0 + }, + "校正间隙": { + "id": 179, + "unit": "mEq/L", + "type": "float", + "range": [ + -10.0, + 10.0 + ], + "precision": 2 + }, + "正常白蛋白": { + "id": 180, + "unit": "gm/dL", + "type": "float", + "range": [ + 3.5, + 5.0 + ], + "precision": 2 + }, + "观察到白蛋白": { + "id": 181, + "unit": "gm/dL", + "type": "float", + "range": [ + 2.0, + 5.0 + ], + "precision": 2 + }, + "无囊气管导管大小": { + "id": 182, + "unit": "mm (ID)", + "type": "float", + "range": [ + 2.0, + 10.0 + ], + "precision": 1 + }, + "有囊气管导管大小": { + "id": 183, + "unit": "mm (ID)", + "type": "float", + "range": [ + 3.0, + 12.0 + ], + "precision": 1 + }, + "功能残气量": { + "id": 184, + "unit": "L", + "type": "float", + "range": [ + 1.0, + 3.5 + ], + "precision": 2 + }, + "深吸气量": { + "id": 185, + "unit": "L", + "type": "float", + "range": [ + 1.5, + 3.5 + ], + "precision": 2 + }, + "肺总量": { + "id": 186, + "unit": "L", + "type": "float", + "range": [ + 3.0, + 8.0 + ], + "precision": 2 + }, + "肺活量": { + "id": 187, + "unit": "L", + "type": "float", + "range": [ + 1.5, + 5.0 + ], + "precision": 2 + }, + "闭合气量": { + "id": 188, + "unit": "L", + "type": "float", + "range": [ + 0.5, + 2.0 + ], + "precision": 2 + }, + "闭合容积-肺活量比值": { + "id": 189, + "unit": "%", + "type": "float", + "range": [ + 5.0, + 30.0 + ], + "precision": 2 + }, + "闭合气量-肺总量比值": { + "id": 190, + "unit": "%", + "type": "float", + "range": [ + 5.0, + 20.0 + ], + "precision": 2 + }, + "残气容积-肺总量比值": { + "id": 191, + "unit": "%", + "type": "float", + "range": [ + 20.0, + 40.0 + ], + "precision": 2 + }, + "补呼气容积": { + "id": 192, + "unit": "L", + "type": "float", + "range": [ + 0.5, + 1.5 + ], + "precision": 2 + }, + "残气容积": { + "id": 193, + "unit": "L", + "type": "float", + "range": [ + 1.0, + 3.0 + ], + "precision": 2 + }, + "补吸气容积": { + "id": 194, + "unit": "L", + "type": "float", + "range": [ + 1.5, + 3.0 + ], + "precision": 2 + }, + "潮气容积": { + "id": 195, + "unit": "L", + "type": "float", + "range": [ + 0.3, + 0.8 + ], + "precision": 2 + }, + "闭合容积": { + "id": 196, + "unit": "L", + "type": "float", + "range": [ + 0.5, + 2.0 + ], + "precision": 2 + }, + "尿素分布容积女性": { + "id": 197, + "unit": "L", + "type": "float", + "range": [ + 15.0, + 30.0 + ], + "precision": 2 + }, + "尿素分布容积男性": { + "id": 198, + "unit": "L", + "type": "float", + "range": [ + 20.0, + 40.0 + ], + "precision": 2 + }, + "血清腹水白蛋白梯度": { + "id": 199, + "unit": "gm/dL", + "type": "float", + "range": [ + 1.1, + 2.5 + ], + "precision": 2 + }, + "血清白蛋白": { + "id": 200, + "unit": "gm/dL", + "type": "float", + "range": [ + 3.5, + 5.0 + ], + "precision": 2 + }, + "腹水白蛋白": { + "id": 201, + "unit": "gm/dL", + "type": "float", + "range": [ + 1.0, + 3.0 + ], + "precision": 2 + }, + "绝对获益增加率": { + "id": 202, + "unit": "fraction", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "相对获益增加率": { + "id": 203, + "unit": "fraction", + "type": "float", + "range": [ + 0.0, + 5.0 + ], + "precision": 2 + }, + "NNT": { + "id": 204, + "unit": "#", + "type": "float", + "range": [ + 1.0, + 100.0 + ], + "precision": 2 + }, + "对照组事件发生率": { + "id": 205, + "unit": "fraction", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "试验组事件发生率": { + "id": 206, + "unit": "fraction", + "type": "float", + "range": [ + 0.0, + 1.0 + ], + "precision": 2 + }, + "尿肌酐浓度": { + "id": 207, + "unit": "mg/dL", + "type": "float", + "range": [ + 50.0, + 200.0 + ], + "precision": 2 + }, + "每日尿量": { + "id": 208, + "unit": "mL", + "type": "float", + "range": [ + 500.0, + 3000.0 + ], + "precision": 2 + }, + "天数尿量": { + "id": 209, + "unit": "mL", + "type": "float", + "range": [ + 500.0, + 3000.0 + ], + "precision": 2 + }, + "去脂体重": { + "id": 210, + "unit": "kg", + "type": "float", + "range": [ + 20.0, + 100.0 + ], + "precision": 2 + }, + "DLCO预测值校正": { + "id": 211, + "unit": "mL CO (STPD)/min/mmHg", + "type": "float", + "range": [ + 5.0, + 30.0 + ], + "precision": 2 + }, + "血红蛋白": { + "id": 212, + "unit": "g/dL", + "type": "float", + "range": [ + 12.0, + 16.0 + ], + "precision": 2 + }, + "DLCO预测值": { + "id": 213, + "unit": "mL CO (STPD)/min/mmHg", + "type": "float", + "range": [ + 5.0, + 30.0 + ], + "precision": 2 + }, + "蛋白质排泄": { + "id": 214, + "unit": "gm/day", + "type": "float", + "range": [ + 0.0, + 3.5 + ], + "precision": 2 + }, + "随机尿蛋白": { + "id": 215, + "unit": "mg/dL", + "type": "float", + "range": [ + 0.0, + 30.0 + ], + "precision": 2 + }, + "随机尿肌酐": { + "id": 216, + "unit": "mg/dL", + "type": "float", + "range": [ + 50.0, + 200.0 + ], + "precision": 2 + }, + "Kt/VDaugirdas": { + "id": 217, + "unit": "", + "type": "float", + "range": [ + 1.0, + 1.5 + ], + "precision": 2 + }, + "Kt/VLowrie": { + "id": 218, + "unit": "", + "type": "float", + "range": [ + 1.0, + 1.5 + ], + "precision": 2 + }, + "Kt/VKeshaviah": { + "id": 219, + "unit": "", + "type": "float", + "range": [ + 1.0, + 1.5 + ], + "precision": 2 + }, + "Kt/VBarth": { + "id": 220, + "unit": "", + "type": "float", + "range": [ + 1.0, + 1.5 + ], + "precision": 2 + }, + "Kt/VBasile": { + "id": 221, + "unit": "", + "type": "float", + "range": [ + 1.0, + 1.5 + ], + "precision": 2 + }, + "Kt/VJindal": { + "id": 222, + "unit": "", + "type": "float", + "range": [ + 1.0, + 1.5 + ], + "precision": 2 + }, + "Kt/VKerr": { + "id": 223, + "unit": "", + "type": "float", + "range": [ + 1.0, + 1.5 + ], + "precision": 2 + }, + "透析前尿素氮": { + "id": 224, + "unit": "mg%", + "type": "float", + "range": [ + 10.0, + 50.0 + ], + "precision": 2 + }, + "透析后尿素氮": { + "id": 225, + "unit": "mg%", + "type": "float", + "range": [ + 5.0, + 25.0 + ], + "precision": 2 + }, + "小时": { + "id": 226, + "unit": "hr", + "type": "float", + "range": [ + 0.0, + 24.0 + ], + "precision": 2 + }, + "UFVol": { + "id": 227, + "unit": "L", + "type": "float", + "range": [ + 0.0, + 5.0 + ], + "precision": 2 + }, + "透析后体重": { + "id": 228, + "unit": "kg", + "type": "float", + "range": [ + 20.0, + 150.0 + ], + "precision": 2 + }, + "患者凝血酶原时间": { + "id": 229, + "unit": "sec", + "type": "float", + "range": [ + 10.0, + 15.0 + ], + "precision": 2 + }, + "凝血酶原时间参考值": { + "id": 230, + "unit": "sec", + "type": "float", + "range": [ + 10.0, + 15.0 + ], + "precision": 2 + }, + "血总胆红素": { + "id": 231, + "unit": "mg/dL", + "type": "float", + "range": [ + 0.1, + 1.2 + ], + "precision": 2 + }, + "血浆白蛋白": { + "id": 232, + "unit": "gm/dL", + "type": "float", + "range": [ + 3.5, + 5.0 + ], + "precision": 2 + }, + "CvO2": { + "id": 233, + "unit": "mL/L", + "type": "float", + "range": [ + 110.0, + 160.0 + ], + "precision": 2 + }, + "CO": { + "id": 234, + "unit": "L/min", + "type": "float", + "range": [ + 4.0, + 8.0 + ], + "precision": 2 + }, + "O2消耗量": { + "id": 235, + "unit": "mL/min", + "type": "float", + "range": [ + 100.0, + 300.0 + ], + "precision": 2 + }, + "O2vSat": { + "id": 236, + "unit": "%", + "type": "float", + "range": [ + 60.0, + 80.0 + ], + "precision": 2 + }, + "PvO2": { + "id": 237, + "unit": "mmHg", + "type": "float", + "range": [ + 30.0, + 40.0 + ], + "precision": 2 + }, + "术后FEV_1": { + "id": 238, + "unit": "L", + "type": "float", + "range": [ + 0.5, + 4.0 + ], + "precision": 2 + }, + "术前FEV_1": { + "id": 239, + "unit": "L", + "type": "float", + "range": [ + 1.0, + 5.0 + ], + "precision": 2 + }, + "切除肺中总灌注的分数": { + "id": 240, + "unit": "fraction", + "type": "float", + "range": [ + 0.0, + 0.5 + ], + "precision": 2 + }, + "Log几率": { + "id": 241, + "unit": "logit", + "type": "float", + "range": [ + 0.0, + 1.0 + ] + }, + "体重指数": { + "id": 242, + "unit": "kg/m^2", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 2 + }, + "风险": { + "id": 243, + "unit": "%", + "type": "float", + "range": [ + 0.0, + 100.0 + ] + }, + "PaO4": { + "id": 244, + "unit": "mmHg", + "type": "float", + "range": [ + 80.0, + 100.0 + ], + "precision": 1 + }, + "DeltaDelta梯度": { + "id": 245, + "unit": "mmol/L", + "type": "float", + "range": [ + 0.0, + 50.0 + ], + "precision": 1 + }, + "呼气流量峰值女性": { + "id": 246, + "unit": "L/min", + "type": "int", + "range": [ + 200.0, + 400.0 + ], + "precision": 0 + }, + "呼气流量峰值男性": { + "id": 247, + "unit": "L/min", + "type": "int", + "range": [ + 300.0, + 600.0 + ], + "precision": 0 + }, + "分数": { + "id": 248, + "unit": "", + "type": "int", + "range": [ + 0.0, + 1.0 + ], + "precision": 0 + }, + "Y": { + "id": 249, + "unit": "number", + "type": "int", + "range": [ + 0.0, + 10000.0 + ], + "precision": 0 + }, + "Z": { + "id": 250, + "unit": "number", + "type": "int", + "range": [ + 0.0, + 10000.0 + ], + "precision": 0 + }, + "每天抽烟量": { + "id": 251, + "unit": "", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "吸烟年数": { + "id": 252, + "unit": "year", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "戒烟年数": { + "id": 253, + "unit": "year", + "type": "int", + "range": [ + 0.0, + 100.0 + ], + "precision": 0 + }, + "天": { + "id": 255, + "unit": "", + "type": "choice", + "range": [ + "1", + "7", + "30", + "90", + "183", + "365", + "730" + ] + }, + "教育程度": { + "id": 256, + "unit": "", + "type": "choice", + "range": [] + }, + "Delta碳酸氢盐": { + "id": 262, + "unit": "mEq/L", + "type": "float", + "range": [ + 22.0, + 30.0 + ], + "precision": 2 + } + } +} \ No newline at end of file diff --git a/internbootcamp/bootcamp/med_calculator/med_calculator.py b/internbootcamp/bootcamp/med_calculator/med_calculator.py index 601a9ae..0ab60c6 100755 --- a/internbootcamp/bootcamp/med_calculator/med_calculator.py +++ b/internbootcamp/bootcamp/med_calculator/med_calculator.py @@ -1,7 +1,11 @@ import json import math import random +<<<<<<< HEAD from bootcamp import Basebootcamp +======= +from internbootcamp.bootcamp.base import Basebootcamp +>>>>>>> remotes/origin/main def remove_boxed(s): if "\\boxed " in s: @@ -154,7 +158,11 @@ class Medcalculatorbootcamp(Basebootcamp): # 医学计算器类 return cases if __name__ == '__main__': +<<<<<<< HEAD bootcamp = MedCalculatorbootcamp(seed=42) +======= + bootcamp = MedCalculatorSandbox(seed=42) +>>>>>>> remotes/origin/main identity = bootcamp.case_generator() print(f'{identity = }') diff --git a/internbootcamp/libs/chemStructure2Property/ChemStructureGenerator.py b/internbootcamp/libs/chemStructure2Property/ChemStructureGenerator.py new file mode 100755 index 0000000..94fddaa --- /dev/null +++ b/internbootcamp/libs/chemStructure2Property/ChemStructureGenerator.py @@ -0,0 +1,279 @@ +import random +from rdkit import Chem +from rdkit import RDLogger +from rdkit.Chem.inchi import MolToInchi +from rdkit.Chem import Crippen + + +class InChIGenerator: + def __init__(self, max_atoms=15, min_atoms=3, elements=None, + seed=None): + RDLogger.DisableLog('rdApp.*') + random.seed(42) if seed is None else random.seed(seed) + self.max_atoms = max_atoms + self.min_atoms = min_atoms + if elements is None: + self.elements = ['C', 'N', 'O', 'S', 'P', 'F', 'Cl', 'Br', 'I'] + else: + self.elements = elements + + def generate_random_molecule_rdkit(self): + """ + Generates a random molecule using RDKit's RWMol. + Can optionally try to assign random stereochemistry. + """ + + rw_mol = Chem.RWMol() # Editable molecule + num_atoms_to_add = random.randint(self.min_atoms, self.max_atoms) + + if num_atoms_to_add == 0: + return None + + # Add the first atom + atom_symbol = random.choice(self.elements) + rw_mol.AddAtom(Chem.Atom(atom_symbol)) + + # Add subsequent atoms and connect them + for i in range(1, num_atoms_to_add): + if not rw_mol.GetNumAtoms(): break + + existing_atom_idx = random.randrange(rw_mol.GetNumAtoms()) + new_atom_symbol = random.choice(self.elements) + new_atom_idx = rw_mol.AddAtom(Chem.Atom(new_atom_symbol)) + + bond_type = random.choice([Chem.BondType.SINGLE, Chem.BondType.SINGLE, Chem.BondType.DOUBLE, Chem.BondType.TRIPLE]) + + rw_mol.AddBond(existing_atom_idx, new_atom_idx, bond_type) + + # Attempt to form rings + if rw_mol.GetNumAtoms() > 2: + num_rings_to_try = random.randint(0, rw_mol.GetNumAtoms() // 3) + for _ in range(num_rings_to_try): + if rw_mol.GetNumAtoms() < 2: break + + atom_indices = list(range(rw_mol.GetNumAtoms())) + if len(atom_indices) < 2: break + + idx1, idx2 = random.sample(atom_indices, 2) + + if rw_mol.GetBondBetweenAtoms(idx1, idx2) is None: + rw_mol.AddBond(idx1, idx2, Chem.BondType.SINGLE) # Usually single for new rings + + try: + mol = rw_mol.GetMol() + Chem.SanitizeMol(mol) # Crucial: checks valency, aromaticity, etc. + + if mol.GetNumAtoms() > 0: + # It might create non-physical or conflicting assignments. + # InChI will represent whatever stereo is defined. + Chem.AssignStereochemistryFrom3D(mol) # If 3D coords were present (not here) + # Or, more directly, find potential chiral centers and assign randomly + chiral_centers = Chem.FindMolChiralCenters(mol, includeUnassigned=True) + for center_idx, stereo_val in chiral_centers: + if stereo_val == '?': # Unassigned + atom = mol.GetAtomWithIdx(center_idx) + if random.choice([True, False]): + atom.SetChiralTag(Chem.ChiralType.CHI_TETRAHEDRAL_CW) + else: + atom.SetChiralTag(Chem.ChiralType.CHI_TETRAHEDRAL_CCW) + # Re-sanitize after modifying chiral tags might be good practice + Chem.SanitizeMol(mol) + return mol + except Exception as e: + # print(f"Debug: RDKit molecule construction/sanitization failed: {e}") + return None + + def generate_n_valid_inchi(self, n): + """ + Generates N valid, unique InChI strings. + kwargs_for_mol_gen are passed to generate_random_molecule_rdkit. + """ + valid_inchi_set = set() + total_attempts_overall = 0 + + while len(valid_inchi_set) < n: + attempts_for_current_inchi = 0 + generated_this_round = False + while not generated_this_round: + total_attempts_overall += 1 + attempts_for_current_inchi += 1 + + mol = self.generate_random_molecule_rdkit() + + if mol: + try: + inchi_string = MolToInchi(mol) + mol = Chem.MolFromInchi(inchi_string) + logp = Crippen.MolLogP(mol) + if inchi_string and inchi_string not in valid_inchi_set: + + valid_inchi_set.add(inchi_string) + generated_this_round = True + break # Found one + except Exception as e: + # This can happen if the molecule is somehow malformed even after sanitization, + # or if InChI generation itself encounters an issue (rare). + print(f"Debug: MolToInchi failed: {e} for SMILES: {Chem.MolToSmiles(mol)}") + pass + + return list(valid_inchi_set) + + +class SMILESGenerator: + def __init__(self, min_len=5, max_len=25, + seed=None): + RDLogger.DisableLog('rdApp.*') + random.seed(42) if seed is None else random.seed(seed) + self.min_len = min_len + self.max_len = max_len + + + def is_valid_smiles(self, smi): + """Checks if a SMILES string is valid using RDKit.""" + if not smi: + return False + mol = Chem.MolFromSmiles(smi, sanitize=False) # Parse without sanitization first + if mol is None: + return False + try: + Chem.SanitizeMol(mol) + return True + except Exception as e: + return False + + def generate_random_smiles_candidate(self): + """ + Generates a random string that might be a SMILES string. + This is a VERY naive generator and will produce many invalid SMILES. + """ + # A basic set of SMILES characters + # More comprehensive: C,c,N,n,O,o,S,s,P,p,F,Cl,Br,I,B,Si,Se,*,[nH],[nH+],[cH-],... + # Also: -,=,#,$,:,.,(,),[,],%,0-9 (for ring closures and isotopes/charges) + atom_chars = ['C', 'N', 'O', 'S', 'F', 'Cl', 'Br', 'I', 'P'] + aromatic_chars = ['c', 'n', 'o', 's'] + bond_chars = ['-', '=', '#'] + branch_chars = ['(', ')'] + ring_digits = [str(i) for i in range(1, 10)] # 1-9 + # More complex elements like charges, isotopes, chiral centers are harder to randomize simply + # For simplicity, we'll stick to a subset. + + all_chars = atom_chars + aromatic_chars + bond_chars + branch_chars + ring_digits + + length = random.randint(self.min_len, self.max_len) + candidate = "" + + candidate += random.choice(atom_chars + aromatic_chars) + + open_parentheses = 0 + open_rings = {} + + for _ in range(length - 1): + choices = [] + weights = [] + + choices.extend(atom_chars + aromatic_chars) + weights.extend([10] * (len(atom_chars) + len(aromatic_chars))) + + if candidate and (candidate[-1].isalpha() or candidate[-1] == ')' or candidate[-1].isdigit()): + choices.extend(bond_chars) + weights.extend([5] * len(bond_chars)) + + + if candidate and (candidate[-1].isalpha() or candidate[-1] == ')' or candidate[-1].isdigit()): + choices.append('(') + weights.append(3) + + if open_parentheses > 0: + choices.append(')') + weights.append(3) + + # Ring closures + if candidate and (candidate[-1].isalpha() or candidate[-1] == ')'): + # Try to close an open ring + open_ring_digits = [d for d, status in open_rings.items() if status == 'open'] + if open_ring_digits and random.random() < 0.5: # 50% chance to close an open ring + digit_to_close = random.choice(open_ring_digits) + choices.append(digit_to_close) + weights.append(5) + else: # Try to open a new ring + available_digits = [d for d in ring_digits if d not in open_rings or open_rings[d] == 'closed'] + if available_digits: + choices.extend(available_digits) + weights.extend([2] * len(available_digits)) + + if not choices: # Fallback if no valid options (e.g., after certain bonds) + chosen_char = random.choice(atom_chars) + else: + chosen_char = random.choices(choices, weights=weights, k=1)[0] + + # Update state + if chosen_char == '(': + open_parentheses += 1 + elif chosen_char == ')': + if open_parentheses > 0: + open_parentheses -= 1 + else: + continue # Don't add a closing parenthesis if none are open + elif chosen_char in ring_digits: + if chosen_char not in open_rings or open_rings[chosen_char] == 'closed': + open_rings[chosen_char] = 'open' + elif open_rings[chosen_char] == 'open': + open_rings[chosen_char] = 'closed' + + candidate += chosen_char + + # Attempt to close any remaining open parentheses + candidate += ')' * open_parentheses + + # Attempt to close any remaining open rings (very crudely) + for digit, status in open_rings.items(): + if status == 'open': + # Find a suitable place to close it - this is hard without graph info + # For now, just append another atom and the digit if possible + if candidate and (candidate[-1].isalpha() or candidate[-1] == ')'): + if random.random() < 0.7 and len(candidate) < self.max_len -1 : # Add another atom then close + candidate += random.choice(atom_chars) + digit + else: # Just append the digit (might be invalid) + candidate += digit + + + return candidate + + def generate_n_valid_smiles(self, n): + """Generates N valid, unique (canonical) SMILES strings.""" + valid_smiles_set = set() + total_attempts_overall = 0 + + print(f"Attempting to generate {n} valid SMILES (min_len={self.min_len}, max_len={self.max_len})...") + while len(valid_smiles_set) < n: + attempts_for_current_smiles = 0 + generated_this_round = False + while not generated_this_round: + total_attempts_overall += 1 + attempts_for_current_smiles += 1 + candidate = self.generate_random_smiles_candidate() + + if self.is_valid_smiles(candidate): + mol = Chem.MolFromSmiles(candidate) # Re-parse to be sure and for canonicalization + if mol: # Should be true if is_valid_smiles passed + canonical_smi = Chem.MolToSmiles(mol, isomericSmiles=True, canonical=True) + try: + mol = Chem.MolFromSmiles(canonical_smi) + logp = Crippen.MolLogP(mol) + if canonical_smi not in valid_smiles_set: + valid_smiles_set.add(canonical_smi) + # print(f"Generated ({len(valid_smiles_set)}/{n}): {canonical_smi} (after {attempts_for_current_smiles} attempts for this one, {total_attempts_overall} total)") + generated_this_round = True + break # Found one, move to the next + except Exception as e: + pass + + return list(valid_smiles_set) + +if __name__ == "__main__": + aInChIGenerator = InChIGenerator(max_atoms=15, min_atoms=3) + inchi_10 = aInChIGenerator.generate_n_valid_inchi(10) + print(inchi_10) + aSMILESGenerator = SMILESGenerator(min_len=5, max_len=25) + smiles_10 = aSMILESGenerator.generate_n_valid_smiles(10) + print(smiles_10) \ No newline at end of file