Showing posts with label GenAI. Show all posts
Showing posts with label GenAI. Show all posts

Saturday, April 26, 2025

Part 2 of series on Amazing power of HL7 FHIR and GenAI

For the past one week I have been working on part 2 of the series (refer to the overview of the series here - https://healthinterconnect.blogspot.com/2025/04/amazing-power-of-hl7-fhir-supercharged.html ). This time my purpose is to create CRUD page for Encounter resource based on its FHIR resource structure definition. It took longer than I expected, probably took about more than 8 hour. 

There are few challenges

1) Even though the FHIRResourceUIDevGuide.md  is able to generate the dynamic CRUD page based on Encounter resource structure definition, however these fields do not work properly - CodeableConcept or Coding such as Encounter.class, or fields which refer to other resources eg Encounter.serviceProvider. I think it took me more than 20 iterations so that the dropdown for these fields are showing correctly

2) After these dropdown fields are showing correctly, still spent few iterations to make sure the UI shows the selected field

3) Another issue is that the AI does not work consistently. For example when I asked Copilot to generate PatientCrudPage, some of the previous prompts working in EncounterCrudPage are not rendering the same outcome in PatientCrudPage.

My key takeaway for part 1 is that AI can help me start very fast, however during part 2, the key take away is that it starts to get slower, and I am starting to get prompt fatigue.

Thus for part 2, I will continue to use the EncounterCrudPage created to refine the original prompt instructions in FHIRResourceUIDevGuide.md , hopefully it will be getting smarter and smarter, and reduce the iterations of prompt

However in general, the GenAI is still very impressive, below is few example

1) I asked Copilot to organize the UI layout of the data elements based on FHIR resource structure. Take the use case of Encounter resource, I asked Copilot to arrange the data elements directly under Encounter resource root level as "Overview" section, and the elements under Encounter backbone level in the respective groups - Diagnosis, Participant, Reason, Location and Admission

2) Initially the dropdown input is not working, it encountered error upon saving, as the field is immutable, it is able to identify the root cause and fixed the issue


GitHub Copilot

I see the issue now. The errors in the console indicate that we're trying to modify objects that are immutable. This typically happens when React's strict mode is enabled or when the state objects are frozen. Let's make deep copies of the objects before modifying them.

Let me fix the error by updating the handleInputChange function to ensure we're creating new objects rather than trying to modify existing ones:


Below is the screnshot of the generated Encounter Crud Page, you can check out the source code at https://github.com/sg-victorchai/AgenticFHIR and run locally.






Amazing power of HL7 FHIR supercharged by Gen AI

I will be sharing 5-part series to demonstrate the amazing power of HL7 FHIR and GenAI assisted development.


  1. Use FHIR StructureDefinition meta resource to identify the key data elements of domain resource eg Observation and CarePlan, and automatically create the record summary list page on UI
  2. Use data elements defined in FHIR StructureDefinition meta resource to auto render the CRUD form for the domain resource eg CarePlan
  3. Use FHIR SearchParameter meta resource to identify the search parameters for the domain resource eg CarePlan,  automatically render filtering fields in record summary list UI
  4. Use data validation rules defined in FHIR StructureDefinition to perform UI level data validation
  5. Use FHIR OperationDefinition to inspect the APIs and its input/output parameters of each API, and generate UI to allow users to perform specific actions, eg show "Reschedule appointment" button on UI if the backend API supports rescheduling appointment, and then bring users to the appointment reschedule UI with the input parameters specified in the OperationDefinition.


If you are developer, and still not sure how to leverage Gen AI, then you'd better quickly get yourself dive into this once-in-a-lifetime revolution.

I think the best way to get started is to hop on to the repo I just published on GitHub, you can check out and try to create new Summary list view and CRUD page using the prompt instruction md I have already created, all can be done without coding (Vibe coding)





Thursday, October 10, 2024

Public Sector Day Singapore 2024


I was delighted to be invited by AWS to share how we designed and implemented robust tech foundation for Singapore Healthier SG and Age Well SG at recent Public Sector Day Singapore 2024 on 03 Oct 202

It is hard to design robust future ready tech foundation for such large scale solution with extremely high throughout and fast performance, in generally all the APIs are performing at around 0.2 to 0.3 second even at peak volume. It is also relatively easy if the team has been consciously investing in the following four areas

  1. Deeper understanding of business domains, ability to shape the requirements, and ability to predict what will come next
  2. Deeper understanding of technologies - products/solutions and industry trend, set future ready technology direction, be ready to transform your team, the organisation and the industry
  3. Once you are equipped with deep understanding of business and technology, you will be naturally have the courage and determination to hold the vision and direction
  4. Build strong team whom you can count on so that you are confident that things will work out well even though some parts are not clear or fully sorted out yet at beginning
The two pillars of our strong tech foundation are AWS cloud platform and HL7 FHIR
  1. AWS has the broadest and richest cloud services for us to build modern cloud native and highly resilient applications
    • Use API GW, AWS EKS, RDS,SQS, Lambda and ActiveMQ for transactional part of the application
    • Use AWS Glue, AWS Data Lake for Operational Data Store 
    • Use AWS BedRock for RAG implementation
  2. HL7 FHIR provides suite of framework for us to build future proof applications
    • Use HL7 Extended Operation to define fined grained APIs to be accessed by external systems
    • Use HL7 FHIR data model as basis for our internal data model, so that it can support any future business needs without change to the data model
    • HL7 FHIR Profile as data validation control for API, any ongoing changes are handled with simple update to the profile without single line of code at all. For example, if we need to support different set of goals and activities for Health Plan, we can just update the profile for Health Plan API
    • Use "SQL On FHIR" to have universal transformation to transform any data subject to any data format required by data analysis and visualisation tool


Below are some photos taken during the public sector day  and the slides (in MP4 format at the bottom of this post)

Enjoy!
















FHIR Up the Healthcare Transformation - Interoperability, Data Liquidity, and the Agentic Future

  A Letter to the Healthcare IT Community This week, Tim Cook published his farewell letter as Apple CEO. In it, he reflected on how Apple...