RadCases

# RadCases Dataset

This HuggingFace (HF) dataset contains the raw case labels for input patient "one-liner" case summaries according to the [ACR Appropriateness Criteria](https://www.acr.org/Clinical-Resources/ACR-Appropriateness-Criteria). Because many of the sources of data used to construct the RadCases dataset require credentialed access, we cannot publicly release the input patient case summaries. Instead, the "cases" included in this publicly available dataset are the cryptographically secure SHA-512 hashes of the original, "human-readable" cases. In this way, the hashes cannot be used to reconstruct the original RadCases dataset, but *can* instead be used as a lookup key to determine the ground-truth label for the dataset.

## Setup

Prior to using this dataset, you need to download the raw source of patient one-liners first in compliance with each of the source-specific licenses and data usage agreements. The setup process is different for each of the different dataset sources:

  1. **Synthetic**: The Synthetic dataset is composed of patient one-liners synthetically generated by OpenAI's ChatGPT. You can find the raw dataset at [this GitHub link](https://github.com/michael-s-yao/radGPT/blob/74700a8b762232729caec61455a3169c5499b14c/radgpt/data/synthetic.csv). No additional setup steps are required for the Synthetic RadCases dataset.
  2. **USMLE**: The USMLE dataset is comprised of practice USMLE Step- 2 and 3 cases from Medbullets that are made available by [Chen et al. (2024).](https://doi.org/10.48550/arXiv.2402.18060) The dataset is made publicly available by the cited authors at [this GitHub link](https://raw.githubusercontent.com/HanjieChen/ChallengeClinicalQA/dc1bc9f6923ea0ecafe2a033346b8f898e8a622c) - we extract the first sentence of each question stem to use as an input patient one-liner in the RadCases dataset.
  3. **JAMA**: The JAMA dataset is comprised of challenging patient one-liners derived from the [JAMA Clinical Challenges](https://jamanetwork.com/collections/44038/clinical-challenge) from the Journal of the American Medical Association (JAMA). Please follow
    the instructions from [`@HanjieChen`](https://github.com/HanjieChen) [here](https://github.com/HanjieChen/ChallengeClinicalQA/blob/main/README.md) to first download the dataset. We extract the first sentence of each clinical challenge to use as the input patient one-liner in the RadCases dataset.
  4. **NEJM**: The NEJM dataset is comprised of challenging patient one-liners derived from the [NEJM Case Records of the Massachusetts General Hospital](https://www.nejm.org/browse/nejm-article-type/case-records-of-the-massachusetts-general-hospital) from the New England Journal of Medicine (NEJM). We provide a script [`build_nejm_dataset.py`](https://github.com/michael-s-yao/radGPT/blob/d97d4617297a1df6e3712f2c8842600ef8b826dc/scripts/build_nejm_dataset.py) to scrape the case records from the DOIs listed [here](https://github.com/michael-s-yao/radGPT/blob/d97d4617297a1df6e3712f2c8842600ef8b826dc/radgpt/data/nejm.txt), which are the same as those used by [Savage et al. (2024).](https://www.nature.com/articles/s41746-024-01010-1). The resulting `nejm.jsonl` file generated by the script should then be added to the `radGPT` home directory.
  5. **BIDMC**: The Beth Israel Deaconess Medical Center (BIDMC) dataset is comprised of real anonymized, de-identified patient one-liners derived from the [MIMIC-IV Dataset](https://www.nature.com/articles/s41597-022-01899-x). Please request access to the MIMIC-IV dataset [here](https://physionet.org/content/mimic-iv-note/2.2/). The `discharge.csv.gz` file should then be added to the [`radGPT/radgpt/data`](https://github.com/michael-s-yao/radGPT/tree/main/radgpt/data) directory.

## Dataset Structure

Each row of the dataset is a (SHA-512 hash of a) patient "one-liner" **case** mapping to an ACR Appropriateness Criteria **topic**, and also the parent **panel** of that topic.

  - `case`: the SHA-512 hash of the patient one-liner
  - `panel`: the ACR Appropriateness Criteria panel label of the patient one-liner
  - `topic`: the ACR Appropriateness Criteria topic label of the patient one-liner

## Retrieving A Label

To retrieve a ground-truth ACR label from this dataset, you can use the following source code:

```python
import hashlib

prompt = input("Patient One-Liner Case: ")
hash_gen = hashlib.sha512()
hash_gen.update(prompt.encode())
hash_val = str(hash_gen.hexdigest())
```

The corresponding `hash_val` variable can then be used to lookup the corresponding `panel` or `topic` by matching `hash_val` with the `case` value in the RadCases dataset.

## Direct Dataset Usage

You can download the contents of this dataset using the following terminal command:

```
git clone https://huggingface.co/datasets/michaelsyao/RadCases
```

Introducing paper: Evidence Is All You Need: Ordering Imaging Studies via Language Model Alignment with the ACR Appropriateness Criteria