Thursday, January 15, 2026

Amazing speed of rapid data preparation with power of HL7 FHIR and AI

Recently I am switching the backend API server of my application to HAPI FHIR server located at http://hapi.fhir.org/baseR5. Previously, I manually created the data using Postman, this time, I choose to use AI tool (Claude Code) to prepare the test data. 

It took me less than 1 minute to write the prompt and Claude is able to generate very comprehensive data including Patient, Observation, MedicationRequest, and CarePlan. I also requested the AI to use the respective terminology code such as SNOMED CT, RxNorm and LOINC. For CarePlan, I also requested the AI to include Goal resource

If doing it manually, it will take days, and it is not repeatable. Secondly it also removed the barrier where the engineer needs to have some understanding of clinical terminologies.


1. First I enter the following prompt - "i need to create HL7 FHIR data in HAPI FHIR public server located at this url - http://hapi.fhir.org/baseR5/. Bewlow is the detail instrucitons to create the sample data " . 

2. Claude immediately highlighted that it seems the message got cut off. So I added further instructions 

create 10 patients, for each patient, please create 5 records of Encounter, Observation, MedicationReqeust and CarePlan, make sure the observation, medicationrequest and careplan have correct reference to the encounter resource.   


For the medicationrequest, can you use the US RxNorm code to represent the medications required to treat the common chronic conditions such as diabetes, high blood pressure and cholestrol. For the Observation, pls use LOINC code for typical measurements for the above said chronic conditions. For careplan, please create some realistic care plan to treat the above said chronic conditions with some goals to reach the specific target, pls use SNOMNED CT code where it is possible  


3. Afterwards, Claude generated the bash file and created all these FHIR records on HAPI server, and show the following summary on terminal. 



4. You can view these generated data on HAPI FHIR server, eg if you need to see the MedicationRequest resources created for patient (Id: 831589), you can type the following URL in browser - http://hapi.fhir.org/baseR5/MedicationRequest?patient=831589


5. Below is the screen how the data is shown in my sample application





No comments:

Post a Comment

Amazing speed of rapid data preparation with power of HL7 FHIR and AI

Recently I am switching the backend API server of my application to HAPI FHIR server located at  http://hapi.fhir.org/baseR5 . Previously, I...