From dae86563c2b63190154f47e168121c71f90c75e1 Mon Sep 17 00:00:00 2001 From: Alexander Kiel Date: Fri, 29 Nov 2024 14:09:59 +0100 Subject: [PATCH] Set an UUID in the id Property on the Measure Population Closes: #409 --- .../query/broker/dsf/DSFQueryManager.java | 5 +++-- .../query/broker/dsf/DSFQueryManagerTest.java | 1 + 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/main/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManager.java b/src/main/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManager.java index f9a4416f..d7dbef9a 100644 --- a/src/main/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManager.java +++ b/src/main/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManager.java @@ -291,8 +291,9 @@ private Bundle addMeasure(Bundle queryBundle, UUID libraryId) { .setCode(CODE_SYSTEM_MEASURE_SCORING_VALUE_COHORT))) .addLibrary(createCanonicalUUIDUrn(libraryId)); - measure.addGroup().addPopulation() - .setCode(new CodeableConcept() + var population = measure.addGroup().addPopulation(); + population.setId(UUID.randomUUID().toString()); + population.setCode(new CodeableConcept() .addCoding(new Coding() .setSystem(CODE_SYSTEM_MEASURE_POPULATION) .setCode(CODE_SYSTEM_MEASURE_POPULATION_VALUE_INITIAL_POPULATION))) diff --git a/src/test/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManagerTest.java b/src/test/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManagerTest.java index 91671337..8aabd902 100644 --- a/src/test/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManagerTest.java +++ b/src/test/java/de/numcodex/feasibility_gui_backend/query/broker/dsf/DSFQueryManagerTest.java @@ -155,6 +155,7 @@ public void testPublishQuery() assertEquals(1, measure.getMeta().getProfile().stream().filter(p -> p.getValueAsString() .equals("http://medizininformatik-initiative.de/fhir/StructureDefinition/feasibility-measure")) .count()); + assertEquals(36, measure.getGroupFirstRep().getPopulationFirstRep().getId().length()); assertEquals("http://medizininformatik-initiative.de/fhir/CodeSystem/feasibility", measureReferenceSystem); }