Skip to content

Commit dcf27fe

Browse files
committed
[AEA-6305] review comments
1 parent d9a208a commit dcf27fe

2 files changed

Lines changed: 36 additions & 34 deletions

File tree

src/main/java/software/nhs/fhirvalidator/controller/ValidateController.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ public OperationOutcome parseAndValidateResource(String input) {
7979
| DataFormatException e) {
8080
log.error(e.toString());
8181
return OperationOutcomeUtils
82-
.createOperationOutcome((e.getMessage() != null && !e.getMessage().contains("null")) ? e.getMessage() : "Invalid JSON", null);
82+
.createOperationOutcome((e.getMessage() != null && !(e instanceof NullPointerException))
83+
? e.getMessage() : "Invalid JSON", null);
8384
}
8485
}
8586

src/test/resources/results/searchSet.json

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -2393,41 +2393,42 @@
23932393
]
23942394
},
23952395
{
2396-
"extension": [
2397-
{
2398-
"url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-line",
2399-
"valueInteger": 1
2400-
},
2401-
{
2402-
"url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col",
2403-
"valueInteger": 496
2404-
}
2405-
],
2406-
"severity": "warning",
2407-
"code": "processing",
2408-
"diagnostics": "Constraint failed: dom-6: 'A resource should have narrative for robust management' (defined in http://hl7.org/fhir/StructureDefinition/DomainResource) (Best Practice Recommendation)",
2409-
"location": [
2410-
"OperationOutcome",
2411-
"Line[1] Col[496]"
2412-
]
2413-
},
2414-
{
2415-
"extension": [
2416-
{
2396+
"extension": [
2397+
{
24172398
"url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-line",
24182399
"valueInteger": 1
2419-
},
2420-
{
2400+
},
2401+
{
24212402
"url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col",
24222403
"valueInteger": 496
2423-
}
2424-
],
2425-
"severity": "warning",
2426-
"code": "processing",
2427-
"diagnostics": "Constraint failed: dom-6: 'A resource should have narrative for robust management' (defined in http://hl7.org/fhir/StructureDefinition/DomainResource) (Best Practice Recommendation)",
2428-
"location": [
2429-
"OperationOutcome",
2430-
"Line[1] Col[496]"
2431-
]
2432-
}]
2404+
}
2405+
],
2406+
"severity": "warning",
2407+
"code": "processing",
2408+
"diagnostics": "Constraint failed: dom-6: 'A resource should have narrative for robust management' (defined in http://hl7.org/fhir/StructureDefinition/DomainResource) (Best Practice Recommendation)",
2409+
"location": [
2410+
"OperationOutcome",
2411+
"Line[1] Col[496]"
2412+
]
2413+
},
2414+
{
2415+
"extension": [
2416+
{
2417+
"url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-line",
2418+
"valueInteger": 1
2419+
},
2420+
{
2421+
"url": "http://hl7.org/fhir/StructureDefinition/operationoutcome-issue-col",
2422+
"valueInteger": 496
2423+
}
2424+
],
2425+
"severity": "warning",
2426+
"code": "processing",
2427+
"diagnostics": "Constraint failed: dom-6: 'A resource should have narrative for robust management' (defined in http://hl7.org/fhir/StructureDefinition/DomainResource) (Best Practice Recommendation)",
2428+
"location": [
2429+
"OperationOutcome",
2430+
"Line[1] Col[496]"
2431+
]
2432+
}
2433+
]
24332434
}

0 commit comments

Comments
 (0)