FHIR Test Data: Claude Vs ChatGPT

Two years ago I tried to generate FHIR test data using ChatGPT.

It was early days for AI assistants back then and the results were not promising.

Yesterday I tried again. I’d been working with Claude and ChatGPT a lot in recent months and I was more optimistic.

This time around the results were more positive. But there were noticeable differences between the two AIs.

Here’s the detailed prompt I used:

Create a FHIR R4 transaction Bundle that I can POST to a FHIR server. Each resource in the Bundle should be as fully populated with valid elements as possible. Each resource should be a POST request to the FHIR server.

Populate the Bundle with the following connected resources that represent a patient's visit to a doctor.

- A Patient resource where the patient is 51 years old
- A Practitioner resource that represents the patient's general practitioner
- An Organization resource that represents the GP's surgery
- An Appointment resource that represents the patient’s appointment at 10:30am
- An Encounter resource that represents the visit to the doctor
- An Observation resource that captures a high blood pressure reading for the patient
- A Condition resource where the doctor identifies the patient’s high blood pressure
- A MedicationRequest resource that captures the medication the doctor prescribed to the patient
- A Medication resource that captures the type of medication prescribed
- A follow up Appointment resource for three weeks

Ensure that FHIR R4 resources are used, that all resource references are correctly connected and that each CodeableConcept used is valid and appropriate.

The transaction Bundle should successfully POST into any FHIR R4 server.

I was looking for an everyday visit by a patient to their doctor. I wanted the bundle produced to document:

  • A high blood pressure Observation
  • A matching Condition
  • An appropriate MedicationRequest
  • A scheduled follow up Appointment
  • Richly populated resources for Patient, Practitioner and Organization

Claude and ChatGPT produced a working transaction bundle with all of the above. I POSTed both bundles successfully to my local FHIR server without any modifications.

  • All resource references were correct
  • All CodeableConcepts were acceptable
  • Blood pressure readings were high
  • Medications were correct and valid (I think – not a doctor!)

But there were real difference between Claude and ChatGPT.

The second line of my prompt was:

Each resource in the Bundle should be as fully populated with valid elements as possible.

Claude went above and beyond here whereas ChapGPT was happy just to get the basics right.

Here are just a few of the extras Claude threw in for free:

  • The MedicationRequest included a dispenseRequest (2 refills)
  • Names and addresses that matched my IP address (Dublin, Ireland)
  • Identifiers for Patient and Practitioner that looked real
  • Encounter type and reason codes
  • Richer resource reference connections
  • Fully populated as opposed to sparse resources

Overall I was surprised by how accurate the data produced was.

  • Valid RxNorm code for the Medication
  • Valid Loinc code for the Observation
  • Valid SNOMED code for the Condition

The prompt took 3 minutes to write.

If my objective had been to produce project specific and model specific test data I feel Claude would be up to the job. Its ability to store reference information and produce working artifacts make it ideal for just this sort of project.

Here’s the results — try them out for yourself.

The Claude bundle: https://vanyalabs.com/files/claude_bundle.json
The ChatGPT bundle: https://vanyalabs.com/files/chatgpt_bundle.json

---

Download my “FHIR Architecture Decisions” book

FHIR Weekly

Join 1,100+ business and technical leaders.

Discover more from Darren Devitt

Subscribe now to keep reading and get access to the full archive.

Continue reading