Skip to content

Commit c234322

Browse files
committed
Add :below Modifier To Profile Search
1 parent c8d1617 commit c234322

File tree

5 files changed

+17
-15
lines changed

5 files changed

+17
-15
lines changed

src/main/java/de/medizininformatikinitiative/torch/consent/ConsentFetcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ public ConsentFetcher(DataStore dataStore, ConsentCodeMapper mapper, FhirContext
5454
}
5555

5656
private static Query getConsentQuery(PatientBatch batch) {
57-
return Query.of("Consent", batch.compartmentSearchParam("Consent").appendParam("_profile", stringValue(CDS_CONSENT_PROFILE_URL)));
57+
return Query.of("Consent", batch.compartmentSearchParam("Consent").appendParam("_profile:below", stringValue(CDS_CONSENT_PROFILE_URL)));
5858
}
5959

6060
/**

src/main/java/de/medizininformatikinitiative/torch/consent/ConsentHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public ConsentHandler(DataStore dataStore, ConsentFetcher consentFetcher) {
4848
}
4949

5050
private static Query getEncounterQuery(PatientBatch batch) {
51-
return Query.of("Encounter", batch.compartmentSearchParam("Encounter").appendParam("_profile", stringValue(CDS_ENCOUNTER_PROFILE_URL)));
51+
return Query.of("Encounter", batch.compartmentSearchParam("Encounter").appendParam("_profile:below", stringValue(CDS_ENCOUNTER_PROFILE_URL)));
5252
}
5353

5454
private static Mono<Map<String, Collection<Encounter>>> groupEncounterByPatient(Flux<Encounter> encounters) {

src/main/java/de/medizininformatikinitiative/torch/model/crtdl/annotated/AnnotatedAttributeGroup.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,10 +76,10 @@ private List<QueryParams> queryParams(DseMappingTreeBase mappingTreeBase) {
7676

7777
if (codeParams.isEmpty()) {
7878
// Add a single QueryParams with the date filter (if available) and profile parameter
79-
return List.of(dateParams.appendParam("_profile", stringValue(groupReference)));
79+
return List.of(dateParams.appendParam("_profile:below", stringValue(groupReference)));
8080
} else {
8181
return codeParams.stream()
82-
.map(p -> p.appendParams(dateParams).appendParam("_profile", stringValue(groupReference)))
82+
.map(p -> p.appendParams(dateParams).appendParam("_profile:below", stringValue(groupReference)))
8383
.toList();
8484
}
8585
}

src/test/java/de/medizininformatikinitiative/torch/model/crtdl/annotated/AnnotatedAttributeGroupTest.java

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
import java.util.List;
1616
import java.util.stream.Stream;
1717

18-
import static de.medizininformatikinitiative.torch.model.fhir.QueryParams.*;
18+
import static de.medizininformatikinitiative.torch.model.fhir.QueryParams.codeValue;
19+
import static de.medizininformatikinitiative.torch.model.fhir.QueryParams.dateValue;
20+
import static de.medizininformatikinitiative.torch.model.fhir.QueryParams.stringValue;
1921
import static de.medizininformatikinitiative.torch.model.sq.Comparator.GREATER_EQUAL;
2022
import static de.medizininformatikinitiative.torch.model.sq.Comparator.LESS_EQUAL;
2123
import static org.assertj.core.api.Assertions.assertThat;
@@ -43,7 +45,7 @@ void oneCode() {
4345
var result = attributeGroup.queries(mappingTreeBase, "Observation");
4446

4547
assertThat(result).containsExactly(
46-
new Query("Observation", QueryParams.of("code", codeValue(CODE1)).appendParam("_profile", stringValue("groupRef")))
48+
new Query("Observation", QueryParams.of("code", codeValue(CODE1)).appendParam("_profile:below", stringValue("groupRef")))
4749
);
4850
}
4951

@@ -57,8 +59,8 @@ void twoCodes() {
5759
var result = attributeGroup.queries(mappingTreeBase, "Observation");
5860

5961
assertThat(result).containsExactly(
60-
new Query("Observation", QueryParams.of("code", codeValue(CODE1)).appendParam("_profile", stringValue("groupRef"))),
61-
new Query("Observation", QueryParams.of("code", codeValue(CODE2)).appendParam("_profile", stringValue("groupRef")))
62+
new Query("Observation", QueryParams.of("code", codeValue(CODE1)).appendParam("_profile:below", stringValue("groupRef"))),
63+
new Query("Observation", QueryParams.of("code", codeValue(CODE2)).appendParam("_profile:below", stringValue("groupRef")))
6264
);
6365
}
6466

@@ -70,7 +72,7 @@ void dateFilter() {
7072
var result = attributeGroup.queries(mappingTreeBase, "Observation");
7173

7274
assertThat(result).containsExactly(
73-
new Query("Observation", QueryParams.of("date", dateValue(GREATER_EQUAL, DATE_START)).appendParam("date", dateValue(LESS_EQUAL, DATE_END)).appendParam("_profile", stringValue("groupRef")))
75+
new Query("Observation", QueryParams.of("date", dateValue(GREATER_EQUAL, DATE_START)).appendParam("date", dateValue(LESS_EQUAL, DATE_END)).appendParam("_profile:below", stringValue("groupRef")))
7476
);
7577
}
7678

@@ -87,4 +89,4 @@ void filtersIgnoredForPatient() {
8789
}
8890
}
8991

90-
}
92+
}

src/test/resources/BlazeBundle.json

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -368,7 +368,7 @@
368368
"id": "VHF00006-E-1-A-1",
369369
"meta": {
370370
"profile": [
371-
"https://www.medizininformatik-initiative.de/fhir/core/modul-fall/StructureDefinition/KontaktGesundheitseinrichtung"
371+
"https://www.medizininformatik-initiative.de/fhir/core/modul-fall/StructureDefinition/KontaktGesundheitseinrichtung|2024"
372372
]
373373
},
374374
"status": "finished",
@@ -590,7 +590,7 @@
590590
"id": "1",
591591
"meta": {
592592
"profile": [
593-
"https://www.medizininformatik-initiative.de/fhir/core/modul-person/StructureDefinition/Patient"
593+
"https://www.medizininformatik-initiative.de/fhir/core/modul-person/StructureDefinition/Patient|123"
594594
]
595595
},
596596
"identifier": [
@@ -677,7 +677,7 @@
677677
"id": "b84c9b34-d374-4d76-ae61-544ecb84265f",
678678
"meta": {
679679
"profile": [
680-
"https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/ObservationLab"
680+
"https://www.medizininformatik-initiative.de/fhir/core/modul-labor/StructureDefinition/ObservationLab|2025"
681681
]
682682
},
683683
"status": "final",
@@ -1243,8 +1243,8 @@
12431243
"versionId": "6",
12441244
"lastUpdated": "2024-09-27T09:01:54.858Z",
12451245
"profile": [
1246-
"http://fhir.de/ConsentManagement/StructureDefinition/Consent",
1247-
"https://www.medizininformatik-initiative.de/fhir/modul-consent/StructureDefinition/mii-pr-consent-einwilligung"
1246+
"http://fhir.de/ConsentManagement/StructureDefinition/Consent|2023",
1247+
"https://www.medizininformatik-initiative.de/fhir/modul-consent/StructureDefinition/mii-pr-consent-einwilligung|2025"
12481248
]
12491249
},
12501250
"resourceType": "Consent",

0 commit comments

Comments
 (0)