Conversation
There was a problem hiding this comment.
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"; |
There was a problem hiding this comment.
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.
| 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); |
| // 4. Birth date | ||
| if (patient.hasBirthDate()) { | ||
| final var birthDate = new IVLTS(); | ||
| birthDate.setValue(patient.getBirthDateElement().getValueAsString().replace("-","")); |
There was a problem hiding this comment.
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.
| 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)); | |
| } |
| 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())); |
There was a problem hiding this comment.
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.
| 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)); |
No description provided.