Skip to content

Implement ITI-119 → ITI-47 mapping#193

Closed
qligier wants to merge 1 commit into
masterfrom
iti119
Closed

Implement ITI-119 → ITI-47 mapping#193
qligier wants to merge 1 commit into
masterfrom
iti119

Conversation

@qligier

@qligier qligier commented Aug 22, 2025

Copy link
Copy Markdown
Collaborator

No description provided.

@qligier qligier requested a review from Copilot August 22, 2025 10:16
@qligier qligier self-assigned this Aug 22, 2025
@qligier qligier added the enhancement New feature or request label Aug 22, 2025
@qligier qligier requested a review from oliveregger August 22, 2025 10:17

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull Request Overview

This PR implements ITI-119 (PDQm Match) → ITI-47 (PDQ) mapping functionality, enabling FHIR-based patient demographics matching to be translated to HL7v3 PDQ queries. The implementation includes all necessary infrastructure components for the ITI-119 transaction and refactors existing ITI-78 code to support reuse in ITI-119.

  • Adds complete ITI-119 transaction support with Camel components, audit strategies, and FHIR resources
  • Creates mapping logic to convert ITI-119 patient match requests to ITI-47 PDQ queries
  • Refactors ITI-78 request converter to extract reusable helper methods for ITI-119

Reviewed Changes

Copilot reviewed 19 out of 19 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
src/main/resources/META-INF/services/org/apache/camel/component/pdqm-iti119 Camel component registration for pdqm-iti119
src/main/java/org/openehealth/ipf/platform/camel/ihe/fhir/iti119/* Core ITI-119 transaction infrastructure including component, endpoint, audit strategies
src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti119/* ITI-119 FHIR resource definitions, constants, and match grade handling
src/main/java/ch/bfh/ti/i4mi/mag/pmir/iti119/* ITI-119 route builder and converters for request/response transformation
src/main/java/ch/bfh/ti/i4mi/mag/pmir/iti78/Iti78* Updates to use centralized constant and refactored helper methods
src/main/java/ch/bfh/ti/i4mi/mag/pmir/PMIRRequestConverter.java Extracted common ITI-47 request building functionality
Comments suppressed due to low confidence (1)

src/main/java/ch/bfh/ti/i4mi/mag/pmir/iti119/Iti119RequestConverter.java:1

  • This line appears to be inconsistent with the surrounding method which creates a patientTelecom but doesn't set semanticsText. The line should either be removed or the method should be updated to properly set the semanticsText.
package ch.bfh.ti.i4mi.mag.pmir.iti119;

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.


@Override
protected String createEndpointUri() {
return "pdqm-iti119:" + "not-implemented yet";

Copilot AI Aug 22, 2025

Copy link

Choose a reason for hiding this comment

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

The endpoint URI creation is incomplete with a hardcoded placeholder string. This should be properly implemented to construct a valid URI based on the endpoint configuration.

Suggested change
return "pdqm-iti119:" + "not-implemented yet";
// Build the URI using configuration values
String host = getConfiguration().getHost();
int port = getConfiguration().getPort();
return String.format("pdqm-iti119:%s:%d", host, port);

Copilot uses AI. Check for mistakes.
// 4. Birth date
if (patient.hasBirthDate()) {
final var birthDate = new IVLTS();
birthDate.setValue(patient.getBirthDateElement().getValueAsString().replace("-",""));

Copilot AI Aug 22, 2025

Copy link

Choose a reason for hiding this comment

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

The date formatting logic using simple string replacement is fragile and may not handle all date formats correctly. Consider using a proper date formatter or the existing transform methods for consistent date handling.

Suggested change
birthDate.setValue(patient.getBirthDateElement().getValueAsString().replace("-",""));
// Use robust date formatting
final var birthDateValue = patient.getBirthDateElement().getValue();
if (birthDateValue != null) {
LocalDate localDate = birthDateValue.toInstant().atZone(ZoneId.systemDefault()).toLocalDate();
DateTimeFormatter formatter = DateTimeFormatter.ofPattern("yyyyMMdd");
birthDate.setValue(localDate.format(formatter));
}

Copilot uses AI. Check for mistakes.
final var ext = patient.getExtensionByUrl(PdqmMatchInputPatient.MOTHERS_MAIDEN_NAME_EXT);
if (ext.getValue() instanceof StringType) {
final var value = (StringType) ext.getValue();
parameterList.addMothersMaidenName(createMothersMaidenName(value.getValue()));

Copilot AI Aug 22, 2025

Copy link

Choose a reason for hiding this comment

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

The extension handling assumes StringType but the PdqmMatchInputPatient class defines mothersMaidenName as HumanName type. This type mismatch could cause the extension to be ignored. The extension should be processed as HumanName to match the class definition.

Suggested change
parameterList.addMothersMaidenName(createMothersMaidenName(value.getValue()));
if (ext.getValue() instanceof HumanName) {
final var humanName = (HumanName) ext.getValue();
// Use the display name if available, otherwise concatenate given and family
String maidenName = humanName.getText();
if (maidenName == null || maidenName.isEmpty()) {
maidenName = String.join(" ", humanName.getGiven().stream().map(g -> g.getValue()).toArray(String[]::new));
if (humanName.hasFamily()) {
maidenName = maidenName.isEmpty() ? humanName.getFamily() : maidenName + " " + humanName.getFamily();
}
}
parameterList.addMothersMaidenName(createMothersMaidenName(maidenName));

Copilot uses AI. Check for mistakes.
@qligier qligier closed this Aug 25, 2025
@qligier qligier deleted the iti119 branch August 25, 2025 15:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants