SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2403.17745 · 2024

Leave No Patient Behind: Enhancing Medication Recommendation for Rare Disease Patients

arXiv · PDF · Open in the Atlas

Code that ran

6 of 7 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 0 have no contract verdict; 5 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2403.17745.json · badge: /api/ran/2403.17745.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
zzhustc2016/raremed canonical (classifier label)
classifier basis: census
6 ran · 1 no recorded run
FunctionStatusWhere it lives
create_dataset Ran
ran; our contract draft was wrong, not the code
zzhustc2016/raremed/src/Baselines/main_LR.py
code served (permissive licence) · get_code("2924bead46e7078e")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

class MockVocab:
    def __init__(self, size):
        self.idx2word = {i: f"word_{i}" for i in range(size)}

# Create mock vocabulary objects with distinct sizes
diag_voc = MockVocab(5)      # diagnosis vocab size: 5
pro_voc = MockVocab(3)       # procedure vocab size: 3
med_voc = MockVocab(4)       # medication vocab size: 4

# Create sample data structure
# data is a list of patients, each patient is a list of visits
# Each visit is a tuple of (diagnoses_indices, procedures_indices, medications_indices)
data = [
    [
        ([0, 1], [0, 2], [1, 2, 3]),      # Patient 0, Visit 0
        ([2], [1], [0, 3]),                # Patient 0, Visit 1
    ],
    [
        ([1, 3], [0], [1, 2]),             # Patient 1, Visit 0
        ([4], [2], [2, 3]),                # Patient 1, Visit 1
    ]
]

ARGS = {
    "data": data,
    "diag_voc": diag_voc,
    "pro_voc": pro_voc,
    "med_voc": med_voc,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
fill_to_max Ran
ran; our contract draft was wrong, not the code
zzhustc2016/raremed/src/Baselines/main_GBert.py
code served (permissive licence) · get_code("67ae73d8372b3db4")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

class SimpleVocab:
    def __init__(self):
        self.word2idx = {
            '[PAD]': 0,
            'hello': 1,
            'world': 2,
            'test': 3
        }

# Create vocabulary
voc = SimpleVocab()

# Create a list to be padded
l = [1, 2, 3]

# Define sequence length
seq_len = 7

ARGS = {
    'l': l,
    'voc': voc,
    'seq_len': seq_len
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_n_params Ran
ran, honoured the contract we drafted
zzhustc2016/raremed/src/Baselines/main_GBert.py
pointer only (licence: MIT); the stored copy get_code serves, from ldkong1205/openess, is pointer only (licence: NONE) · get_code("c6acd3e400fc2676")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from ldkong1205/openess, and GitHub detected no licence in that repository when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

get_visit_weights Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zzhustc2016/raremed/src/Baselines/main_LR.py
code served (permissive licence) · get_code("13c089c1a797040c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function iterates through data as:
# for patient in data:
#     for visit in patient:
#         visit_weights.append(visit[3])
# 
# So data is a list of patients, each patient is a list of visits,
# and each visit is indexable with [3] to get a weight value.

# Construct a minimal valid data structure:
# - data: list of patients
# - each patient: list of visits
# - each visit: list/tuple with at least 4 elements (indices 0, 1, 2, 3)

data = [
    # Patient 1
    [
        [10, 20, 30, 0.5],      # visit 1: weight at index 3 is 0.5
        [11, 21, 31, 0.7],      # visit 2: weight at index 3 is 0.7
    ],
    # Patient 2
    [
        [12, 22, 32, 0.3],      # visit 1: weight at index 3 is 0.3
        [13, 23, 33, 0.9],      # visit 2: weight at index 3 is 0.9
    ]
]

ARGS = {
    "data": data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
random_mask_word Ran
ran; our contract draft was wrong, not the code
zzhustc2016/raremed/src/Baselines/main_GBert_pretrain.py
code served (permissive licence) · get_code("935e128700a0610c")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 1, dtype family int; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import random
import torch

class Vocab:
    def __init__(self):
        self.word2idx = {
            '[MASK]': 0,
            'word1': 1,
            'word2': 2,
            'word3': 3,
            'word4': 4,
            'word5': 5,
        }

torch.manual_seed(0)
random.seed(0)

seq = [1, 2, 3, 4, 5]
vocab = Vocab()

ARGS = {
    'seq': seq,
    'vocab': vocab,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 1, dtype family int — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
t2n Ran
ran; our contract draft was wrong, not the code
zzhustc2016/raremed/src/Baselines/main_GBert.py
code served (permissive licence) · get_code("2c4438c79bd4a86a")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# The function t2n takes a tensor x and converts it to numpy
# It calls .detach(), .cpu(), and .numpy() on the input
# So x must be a torch.Tensor

x = torch.randn(2, 4)

ARGS = {
    "x": x
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
evaluator_nsp Not yet run
unverified (harvested, no recorded run)
zzhustc2016/raremed/src/main_RAREMed.py
code served (permissive licence) · get_code("cd68ad8cad74d0f7")
How it ran

no invocation recorded.

Also present in other papers' code

Of 7 samples lifted from this paper's linked repositories, 7 carry a function identity and 0 do not. Of the 7 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 4 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
get_n_params 14 other papers
11 dated earlier, 3 later
1809.01852 (2018-09)
GAMENet: Graph Augmented MEmory Networks for Recommending Medication Combination
1912.09363 (2019-12)
Temporal Fusion Transformers for Interpretable Multi-horizon Time Series Forecasting
2003.01332 (2020-03)
Heterogeneous Graph Transformer
and 11 more not named here
create_dataset 1 other paper
1 dated earlier
1809.01852 (2018-09)
GAMENet: Graph Augmented MEmory Networks for Recommending Medication Combination
t2n 1 other paper
1 dated earlier
1906.00346 (2019-06)
Pre-training of Graph Augmented Transformers for Medication Recommendation

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Medication recommendation systems have gained significant attention in healthcare as a means of providing tailored and effective drug combinations based on patients' clinical information. However, existing approaches often suffer from fairness issues, as recommendations tend to be more accurate for patients with common diseases compared to those with rare conditions. In this paper, we propose a novel model called Robust and Accurate REcommendations for Medication (RAREMed), which leverages the pretrain-finetune learning paradigm to enhance accuracy for rare diseases. RAREMed employs a transformer encoder with a unified input sequence approach to capture complex relationships among disease and procedure codes. Additionally, it introduces two self-supervised pre-training tasks, namely Sequence Matching Prediction (SMP) and Self Reconstruction (SR), to learn specialized medication needs and interrelations among clinical codes. Experimental results on two real-world datasets demonstrate that RAREMed provides accurate drug sets for both rare and common disease patients, thereby mitigating unfairness in medication recommendation systems.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2403.17745")
get_code_for_paper("2403.17745")
have("2403.17745")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2403.17745.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2403.17745.svg)](https://syntology.ai/paper/2403.17745)

Connect an agent — have() is free.