Commits
84 84 | } |
85 85 | |
86 86 | public PersonInformationCprStatus validateCpr(String patientId) { |
87 87 | try { |
88 88 | HttpUriRequest cprRequest = buildDefaultRequest(patientId, "status"); |
89 89 | PersonInformationCprStatus personInformationCprStatus = (PersonInformationCprStatus) invokeService(cprRequest, requestTypes.STATUS); |
90 90 | serviceErrorCallback.registerServiceSucces(); |
91 91 | return personInformationCprStatus; |
92 92 | } catch (ValidationServiceException e) { |
93 93 | LOGGER.error("Fejl i kald status til PersonInformation: ", e); |
94 - | serviceErrorCallback.registerServiceError(); |
94 + | serviceErrorCallback.registerServiceError(e); |
95 95 | throw e; |
96 96 | } |
97 97 | } |
98 98 | |
99 99 | public int getAge(String patientId) { |
100 100 | try { |
101 101 | HttpUriRequest ageRequest = buildDefaultRequest(patientId, "age"); |
102 102 | int age = (int)invokeService(ageRequest, requestTypes.AGE); |
103 103 | serviceErrorCallback.registerServiceSucces(); |
104 104 | return age; |
105 105 | } catch (ValidationServiceException e) { |
106 106 | LOGGER.error("Fejl i kald age til PersonInformation: ", e); |
107 - | serviceErrorCallback.registerServiceError(); |
107 + | serviceErrorCallback.registerServiceError(e); |
108 108 | throw e; |
109 109 | } |
110 110 | } |
111 111 | |
112 112 | public LinkedList<String> getDeceased(LinkedList<String> listOfCpr, Instant deceasedSince) { |
113 113 | try { |
114 114 | HttpUriRequest deceasedRequest = buildDeceasedRequests(listOfCpr, deceasedSince); |
115 115 | LinkedList<String> partialDeceased = (LinkedList<String>) invokeService(deceasedRequest, requestTypes.DECEASED); |
116 116 | serviceErrorCallback.registerServiceSucces(); |
117 117 | return partialDeceased; |
118 118 | } catch (ValidationServiceException | URISyntaxException e) { |
119 119 | LOGGER.error("Fejl i kald deceased til PersonInformation: ", e); |
120 - | serviceErrorCallback.registerServiceError(); |
120 + | serviceErrorCallback.registerServiceError(e); |
121 121 | throw new ValidationServiceException("Opret af deceased kald til PersonInformation-servicen gik galt.", e); |
122 122 | } |
123 123 | } |
124 124 | |
125 125 | protected Object invokeService(HttpUriRequest request, requestTypes requestType) { |
126 126 | // Construct client |
127 127 | HttpClient client = getClient(); |
128 128 | |
129 129 | // Send request |
130 130 | try { |