-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Christian Ohr
committed
Oct 29, 2024
1 parent
e5d7277
commit 7c29cf5
Showing
15 changed files
with
200 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
.../src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti119/MatchGradeEnumInterceptor.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
/* | ||
* Copyright 2024 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.openehealth.ipf.commons.ihe.fhir.iti119; | ||
|
||
import ca.uhn.fhir.interceptor.api.Hook; | ||
import ca.uhn.fhir.interceptor.api.Interceptor; | ||
import ca.uhn.fhir.interceptor.api.Pointcut; | ||
import ca.uhn.fhir.rest.api.server.RequestDetails; | ||
import org.hl7.fhir.instance.model.api.IBaseResource; | ||
import org.hl7.fhir.r4.model.Bundle; | ||
import org.hl7.fhir.r4.model.Coding; | ||
|
||
import java.util.Optional; | ||
|
||
import static org.openehealth.ipf.commons.ihe.fhir.iti119.AdditionalResourceMetadataKeyEnum.ENTRY_MATCH_GRADE; | ||
|
||
/** | ||
* There is no universal mechanism to attach any kind of search attribute to a response bundle. As ITI-119 asks | ||
* for a custom attribute that cannot been easily be handled within the BundleFactory, an interceptor is required. | ||
* An instance of this interceptor must be registered with the {@link ca.uhn.fhir.rest.server.RestfulServer RestfulServer} or | ||
* the {@link org.openehealth.ipf.commons.ihe.fhir.IpfFhirServlet IpfFhirServlet} subclass. The Spring Boot starter does | ||
* this automatically. | ||
*/ | ||
@Interceptor | ||
public class MatchGradeEnumInterceptor { | ||
|
||
public static final String MATCH_GRADE_EXTENSION_URL = "http://hl7.org/fhir/StructureDefinition/match-grade"; | ||
|
||
@Hook(Pointcut.SERVER_OUTGOING_RESPONSE) | ||
@SuppressWarnings("unused") | ||
public void insertMatchGrades(RequestDetails requestDetails, IBaseResource resource) { | ||
if (resource instanceof Bundle bundle) { | ||
bundle.getEntry().stream() | ||
.filter(Bundle.BundleEntryComponent::hasResource) | ||
.filter(Bundle.BundleEntryComponent::hasSearch) | ||
.filter(bc -> Bundle.SearchEntryMode.MATCH.equals(bc.getSearch().getMode())) | ||
.forEach(entry -> | ||
Optional.ofNullable(ENTRY_MATCH_GRADE.get(entry.getResource())).ifPresent(matchGrade -> | ||
entry.getSearch().addExtension( | ||
MATCH_GRADE_EXTENSION_URL, | ||
new Coding() | ||
.setSystem(matchGrade.getSystem()) | ||
.setCode(matchGrade.toCode())) | ||
) | ||
); | ||
} | ||
} | ||
} |
66 changes: 66 additions & 0 deletions
66
...xpdq/src/main/java/org/openehealth/ipf/commons/ihe/fhir/iti119/PdqmMatchInputPatient.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
/* | ||
* Copyright 2015 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.openehealth.ipf.commons.ihe.fhir.iti119; | ||
|
||
import ca.uhn.fhir.model.api.annotation.Extension; | ||
import ca.uhn.fhir.model.api.annotation.*; | ||
import ca.uhn.fhir.rest.gclient.DateClientParam; | ||
import ca.uhn.fhir.rest.gclient.StringClientParam; | ||
import ca.uhn.fhir.rest.gclient.TokenClientParam; | ||
import ca.uhn.fhir.util.ElementUtil; | ||
import org.hl7.fhir.instance.model.api.IAnyResource; | ||
import org.hl7.fhir.r4.model.*; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
/** | ||
* Patient as defined by the PDQm specification | ||
* | ||
* @author Christian Ohr | ||
* @since 5.0 | ||
*/ | ||
@ResourceDef(name = "Patient", id = "pdqm", profile = "https://profiles.ihe.net/ITI/PDQm/StructureDefinition/IHE.PDQm.MatchInputPatient") | ||
public class PdqmMatchInputPatient extends Patient { | ||
|
||
|
||
@Child(name = "mothersMaidenName") | ||
@Extension(url = "http://hl7.org/fhir/StructureDefinition/patient-mothersMaidenName", definedLocally = false) | ||
@Description(shortDefinition = "Mother's maiden name of a patient") | ||
private HumanName mothersMaidenName; | ||
|
||
@Override | ||
public boolean isEmpty() { | ||
return super.isEmpty() && ElementUtil.isEmpty(mothersMaidenName); | ||
} | ||
|
||
public HumanName getMothersMaidenName() { | ||
if (mothersMaidenName == null) { | ||
mothersMaidenName = new HumanName(); | ||
} | ||
return mothersMaidenName; | ||
} | ||
|
||
public void setMothersMaidenName(HumanName mothersMaidenName) { | ||
this.mothersMaidenName = mothersMaidenName; | ||
} | ||
|
||
public boolean hasMothersMaidenName() { | ||
return this.mothersMaidenName != null && !this.mothersMaidenName.isEmpty(); | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+199 KB
commons/ihe/fhir/r4/pixpdq/src/main/resources/META-INF/profiles/ihe.iti.pdqm.r4.tgz
Binary file not shown.
Binary file added
BIN
+261 KB
commons/ihe/fhir/r4/pixpdq/src/main/resources/META-INF/profiles/ihe.iti.pixm.r4.tgz
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.