File tree Expand file tree Collapse file tree 3 files changed +8
-2
lines changed
main/java/uk/nhs/adaptors/gp2gp/gpc
java/uk/nhs/adaptors/gp2gp/ehr/mapper Expand file tree Collapse file tree 3 files changed +8
-2
lines changed Original file line number Diff line number Diff line change 2020import uk .nhs .adaptors .gp2gp .common .configuration .Gp2gpConfiguration ;
2121import uk .nhs .adaptors .gp2gp .common .service .RandomIdGeneratorService ;
2222import uk .nhs .adaptors .gp2gp .ehr .EhrExtractStatusService ;
23+ import uk .nhs .adaptors .gp2gp .ehr .exception .XmlSchemaValidationException ;
2324import uk .nhs .adaptors .gp2gp .ehr .mapper .EhrExtractMapper ;
2425import uk .nhs .adaptors .gp2gp .ehr .mapper .MessageContext ;
2526import uk .nhs .adaptors .gp2gp .ehr .mapper .OutputMessageWrapperMapper ;
@@ -152,7 +153,12 @@ public String mapStructuredRecordToEhrExtractXml(GetGpcStructuredTaskDefinition
152153 .mapBundleToEhrFhirExtractParams (structuredTaskDefinition , bundle );
153154 String ehrExtractContent = ehrExtractMapper .mapEhrExtractToXml (ehrExtractTemplateParameters );
154155
155- ehrExtractMapper .validateXmlAgainstSchema (ehrExtractContent );
156+ try {
157+ ehrExtractMapper .validateXmlAgainstSchema (ehrExtractContent );
158+ } catch (XmlSchemaValidationException e ) {
159+ LOGGER .error ("EHR Extract XML validation failed: {}" , e .getMessage ());
160+
161+ }
156162
157163 ehrExtractStatusService .saveEhrExtractMessageId (structuredTaskDefinition .getConversationId (),
158164 ehrExtractTemplateParameters .getEhrExtractId ());
Original file line number Diff line number Diff line change 11package uk .nhs .adaptors .gp2gp .ehr .mapper ;
22
33import static org .assertj .core .api .AssertionsForClassTypes .assertThat ;
4+ import static org .junit .jupiter .api .Assertions .assertDoesNotThrow ;
45import static org .mockito .ArgumentMatchers .any ;
56import static org .mockito .ArgumentMatchers .eq ;
67import static org .junit .jupiter .api .Assertions .assertThrows ;
Original file line number Diff line number Diff line change 1- <?xml version =" 1.0" encoding =" UTF-8" ?>
21<RCMR_IN030000UK06 xmlns =" urn:hl7-org:v3" xmlns : xsi =" http://www.w3.org/2001/XMLSchema-instance" xsi : schemaLocation =" urn:hl7-org:v3 ..\Schemas\RCMR_IN030000UK06.xsd" >
32 <id root =" 0D07B623-3926-4245-80AF-97F1098D90C1" />
43 <creationTime value =" 20200101010101" />
You can’t perform that action at this time.
0 commit comments