@@ -79,7 +79,7 @@ public String mapDiagnosticReportToCompoundStatement(DiagnosticReport diagnostic
7979 List <Specimen > specimens = fetchSpecimens (diagnosticReport , observations );
8080 final IdMapper idMapper = messageContext .getIdMapper ();
8181 markObservationsAsProcessed (idMapper , observations );
82- observations = assignDummySpecimensToOrphanedTestResults (observations , specimens );
82+ observations = assignDummySpecimensToObservationsWithNoSpecimen (observations , specimens );
8383
8484 var processedObservations = observations .stream ()
8585 .filter (Predicate .not (DiagnosticReportMapper ::isFilingComment ))
@@ -125,7 +125,7 @@ private List<Specimen> fetchSpecimens(DiagnosticReport diagnosticReport, List<Ob
125125 List <Specimen > specimens = new ArrayList <>();
126126
127127 // At least one specimen is required to exist for any DiagnosticReport, according to the mim
128- if (!diagnosticReport .hasSpecimen () || hasOrphanedTestResults (observations )) {
128+ if (!diagnosticReport .hasSpecimen () || hasObservationsWithoutSpecimen (observations )) {
129129 specimens .add (generateDummySpecimen (diagnosticReport ));
130130 }
131131
@@ -143,17 +143,17 @@ private List<Specimen> fetchSpecimens(DiagnosticReport diagnosticReport, List<Ob
143143
144144 }
145145
146- private boolean hasOrphanedTestResults (List <Observation > observations ) {
146+ private boolean hasObservationsWithoutSpecimen (List <Observation > observations ) {
147147 return observations
148148 .stream ()
149149 .filter (observation -> !isFilingComment (observation ))
150150 .anyMatch (observation -> !observation .hasSpecimen ());
151151 }
152152
153- private List <Observation > assignDummySpecimensToOrphanedTestResults (
153+ private List <Observation > assignDummySpecimensToObservationsWithNoSpecimen (
154154 List <Observation > observations , List <Specimen > specimens ) {
155155
156- if (!hasOrphanedTestResults (observations )) {
156+ if (!hasObservationsWithoutSpecimen (observations )) {
157157 return observations ;
158158 }
159159
0 commit comments