Skip to content

Commit ccc1336

Browse files
committed
Set required recorded field on Provenance resource
The FHIR R4 Provenance resource requires the recorded field (1..1 cardinality). This was missing, making the generated Provenance resources technically invalid.
1 parent 599aea8 commit ccc1336

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

src/main/java/de/medizininformatikinitiative/torch/model/management/ResourceBundle.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -265,6 +265,7 @@ public Bundle toFhirBundle(String extractionId) {
265265
private static Provenance createProvenance(String extractionId, String groupId, List<ResourceGroup> groupResources) {
266266
Provenance provenance = new Provenance();
267267
provenance.setId(PROVENANCE_PREFIX + groupId);
268+
provenance.setRecorded(new Date());
268269

269270
// Add all resources under the same group as targets
270271
groupResources.forEach(rg ->

src/test/java/de/medizininformatikinitiative/torch/ReferenceResolveBlackBoxIT.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void nestedRefResolve() throws IOException {
109109
.allSatisfy(
110110

111111
r -> assertThat(r).extractTopElementNames()
112-
.containsExactlyInAnyOrder("resourceType", "id", "target", "occurredPeriod", "agent", "entity")));
112+
.containsExactlyInAnyOrder("resourceType", "id", "target", "recorded", "occurredPeriod", "agent", "entity")));
113113

114114
// all Encounter in all patient bundles must have the given top fields and have at least one reference in diagnosis.condition
115115
assertThat(patientBundles).allSatisfy(b -> assertThat(b).extractResourcesByType(ResourceType.Encounter)

0 commit comments

Comments
 (0)