Skip to content

Conversation

edwardlo12
Copy link

@edwardlo12 edwardlo12 commented Jun 3, 2025

Due to some reason, I need to make ValueSet expand support "EQUAL".

But I don't know how to write JAVA, so I asked GitHub Copilot to help me.

I had tested the code.

This pull request introduces enhancements to the ValueSet expansion functionality in the HAPI FHIR server, including support for new filtering operations and the ability to load and expand a custom ValueSet based on the ICD-10-CM CodeSystem. Key changes include modifying the filtering logic, adding a comprehensive test for ValueSet expansion, and defining a new ValueSet resource.

Enhancements to filtering logic:

  • TermReadSvcImpl.java: Added support for the EQUAL (=) operator in ValueSet filtering, enabling filtering by specific codes. Includes debug logging for better traceability.

New test for ValueSet expansion:

  • CustomValueSetExpandTest.java: Introduced a new test class to validate the expansion of a custom ValueSet using the ICD-10-CM CodeSystem. The test includes loading the 2023 version of ICD-10-CM, creating a ValueSet, and expanding it using the $expand operation. It also implements retry logic for robustness.

Definition of custom ValueSet resource:

  • my-valueset.json: Added a new JSON resource defining a custom ValueSet named "Esophageal Metal Stent Placement." The ValueSet includes filters using descendent-of, is-a, and = operators on the ICD-10-CM CodeSystem (2023 version).

- Created a new ValueSet resource with ID 2.16.840.1.113762.1.4.1287.10.
- Included metadata such as version, last updated date, and profiles.
- Added extensions for author, last review date, and effective date.
- Defined the ValueSet's URL, identifier, version, name, title, status, date, publisher, and description.
- Composed the ValueSet to include ICD-10-CM codes related to esophageal conditions.
@edwardlo12 edwardlo12 requested a review from fil512 June 13, 2025 00:59
Copy link
Collaborator

@fil512 fil512 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please take a look at #7107 and let me know if that fix meets your needs.

code.getDisplay());

b.must(f.bool()
.should(f.match().field("myParentPids").matching("" + code.getId()))
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this doesn't look right

}

// 4. Print all contains
expanded.getExpansion().getContains().forEach(c -> {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

missing assert

@edwardlo12
Copy link
Author

Please take a look at #7107 and let me know if that fix meets your needs.

YES thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants