mirror of
https://github.com/pcvolkmer/mv64e-onkostar-data.git
synced 2025-09-13 16:02:52 +00:00
feat: add recommendationsMissingReason and noSequencingPerformedReason
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
package dev.pcvolkmer.onco.datamapper.mapper;
|
||||
|
||||
import dev.pcvolkmer.mv64e.mtb.MtbCarePlan;
|
||||
import dev.pcvolkmer.mv64e.mtb.*;
|
||||
import dev.pcvolkmer.onco.datamapper.PropertyCatalogue;
|
||||
import dev.pcvolkmer.onco.datamapper.datacatalogues.EinzelempfehlungCatalogue;
|
||||
import dev.pcvolkmer.onco.datamapper.datacatalogues.TherapieplanCatalogue;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.Arrays;
|
||||
import java.util.List;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import static dev.pcvolkmer.onco.datamapper.mapper.MapperUtils.getPatientReference;
|
||||
|
||||
@@ -59,7 +62,37 @@ public class TherapieplanDataMapper implements DataMapper<MtbCarePlan> {
|
||||
builder.notes(List.of(therapieplanData.getString("protokollauszug")));
|
||||
}
|
||||
|
||||
if (
|
||||
null != therapieplanData.getString("status_begruendung")
|
||||
&& therapieplanData.getString("status_begruendung").equals(MtbCarePlanRecommendationsMissingReasonCodingCode.NO_TARGET.toValue())
|
||||
) {
|
||||
builder.recommendationsMissingReason(
|
||||
MtbCarePlanRecommendationsMissingReasonCoding.builder()
|
||||
.code(MtbCarePlanRecommendationsMissingReasonCodingCode.NO_TARGET)
|
||||
.build()
|
||||
);
|
||||
} else {
|
||||
builder.noSequencingPerformedReason(
|
||||
getCarePlanNoSequencingPerformedReasonCoding(therapieplanData.getString("status_begruendung"))
|
||||
);
|
||||
}
|
||||
|
||||
return builder.build();
|
||||
}
|
||||
|
||||
private CarePlanNoSequencingPerformedReasonCoding getCarePlanNoSequencingPerformedReasonCoding(String value) {
|
||||
if (value == null || !Arrays.stream(NoSequencingPerformedReasonCode.values()).map(NoSequencingPerformedReasonCode::toValue).collect(Collectors.toSet()).contains(value)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
var resultBuilder = CarePlanNoSequencingPerformedReasonCoding.builder();
|
||||
try {
|
||||
resultBuilder.code(NoSequencingPerformedReasonCode.forValue(value));
|
||||
} catch (IOException e) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return resultBuilder.build();
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user