-
Notifications
You must be signed in to change notification settings - Fork 0
Implementation of Consent Manager 2.0 + fixes after reviews #85
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
…e.Instant serialization
Angular Workspace migration. Update an Angular CLI workspace to version 9.
- optimized build inludes/excludes - refactoring - add new classes for master data and encounters - apply new logo and icons
- add comments - refactoring - implement batch registration
fixes after first review #3 (comment)
- add case for http 304 code in error interceptor - refactor request polling
Signed-off-by: Simon H. <huening.simon@gmail.com>
akomii
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Review WIP. Only Java code done so far. Project not buildable via mvn:
[ERROR] ▲ [WARNING] The glob pattern import("./**/*.entry.js*") did not match any files [empty-glob]
[ERROR]
[ERROR] node_modules/@stencil/core/internal/client/index.js:169:2:
[ERROR] 169 │ `./${bundleId}.entry.js${BUILD5.hotModuleReplacement && hmrVers...
[ERROR] ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ERROR]
[ERROR]
[ERROR] ✘ [ERROR] Could not resolve "semantic/dist/semantic.min.css"
[ERROR]
[ERROR] angular:styles/global:styles:2:8:
[ERROR] 2 │ @import 'semantic/dist/semantic.min.css';
[ERROR] ╵ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[ERROR]
[ERROR] You can mark the path "semantic/dist/semantic.min.css" as external to exclude it from the bundle, which will remove this error and leave the unresolved path in the bundle.
[ERROR]
[ERROR]
[ERROR] ✘ [ERROR] Could not resolve "semantic/dist/semantic.js" [plugin angular-script-global]
[ERROR]
[ERROR]
admin-gui/src/main/java/org/aktin/dwh/admin/optin/PatientEntriesRequestDTO.java
Outdated
Show resolved
Hide resolved
| PatientEntry pat = study.getPatientByID(ref, root, ext); | ||
| if (pat != null) { | ||
| log.log(Level.WARNING, "Cannot create entry, PatientEntry already exists."); | ||
| return Response.status(Status.CONFLICT).entity("Patient*in existiert bereits").build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do not sent human-readable error messages. These are endpoints. A machine interacts with them (frontend). The translation to human-readable should be done in Frontend to UI
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
admin-gui/src/main/java/org/aktin/dwh/admin/optin/OptInEndpoint.java
Outdated
Show resolved
Hide resolved
| Study study = this.getStudy(id); | ||
| return study.getPatientByID(ref, root, ext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This logic should be in the service.
So you are calling in StudyManagerImpl an SQL Query to get all Studies
Then you loop to these studies to get a specific study
Then you loop through the found study to get a specific patient
Why not just add the method to StudyManager and implement a SQL Query that does this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because then I do not need to touch two additional packages (dwh-api and dwh-query) and the computational impact should be negligible - correct me if I'm wrong
During a merge a line got deleted by accident. I pushed a fix. |
…as error responses
| <version>3.1.0</version> | ||
| <configuration> | ||
| <warSourceExcludes>node_modules/**,**/*.ts,**/*.js.map,.idea/**,.vscode/**</warSourceExcludes> | ||
| <warSourceExcludes>node_modules/**,.angular/**,*.json,*.md,.browserslistrc,.vscode/**,.idea/**,dist/**,public/**,src/**</warSourceExcludes> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
das soll ja den sourcecode enthalten und nur die kompilierten Teile auslassen. Warum steht hier public/ und src/ als ausnahmen drin?
| debug.log | ||
| *.js | ||
| *.js.map | ||
| semantic |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hier fehlen kommentare was semantic ist und warum das ausgenommen wird.
| ENCOUNTERS_NOT_FOUND, // No encounters in db found | ||
|
|
||
| // Processing States | ||
| VALID, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
was für ein Fehler ist VALID???
| @Path("{studyId}/{sic}") | ||
| @GET | ||
| @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) | ||
| public PatientEntry getEntryBySic(@PathParam("studyId") String id, @PathParam("sic") String sic) throws IOException { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Endpoints should never throw an Exception... Where would it go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see comment above
| PatientEntry pat = study.getPatientByID(ref, root, ext); | ||
| if (pat != null) { | ||
| throw OptInError.buildError(Status.CONFLICT, OptInErrorType.PATIENT_ALREADY_EXISTS, "Cannot create entry, PatientEntry already exists"); | ||
| } | ||
|
|
||
| pat = study.getPatientBySIC(entry.sic); | ||
| if (pat != null) { | ||
| throw OptInError.buildError(Status.CONFLICT, OptInErrorType.SIC_ALREADY_EXISTS, "Cannot create entry, SIC {0} already exists", entry.sic); | ||
| } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, an Endpoint is machine readable. Instead of creating a new Pojo to differentiate existing patient and sics you should use:
throw new ClientErrorException(Status.CONFLICT);Alternatively:
throw new ClientErrorException(
Response.status(Status.CONFLICT)
.type(MediaType.APPLICATION_JSON)
.entity("{detail: OptInErrorType.SIC_ALREADY_EXISTS}")
.build());| @Path("{studyId}/{reference}/{root}{p:/?}{extension:.*}") | ||
| @GET | ||
| @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) | ||
| public Response getEntry(@PathParam("studyId") String id, @PathParam("reference") PatientReference ref, @PathParam("root") String root, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Endpoints should never throw an IOException... Where would it go?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not my original code, we should adress that when the code base gets redesigned eventually
| public Response getEntry(@PathParam("studyId") String id, @PathParam("reference") PatientReference ref, @PathParam("root") String root, | ||
| @PathParam("extension") String ext) throws IOException { | ||
| Study study = this.getStudy(id); | ||
| return Response.ok(study.getPatientByID(ref, root, ext)).build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If study not found, 200 is returned with an empty body
it should be a 404
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getStudy throws a not found exception when empty, but not getPatientByID, I'm going to add it
| * @return list of studies | ||
| * @throws IOException | ||
| */ | ||
| @Path("studies") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Better to just remove the Path annoation for consistency
GET optin/studies -> all studies
GET optin/2 -> all entries of study with id 2??
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
or change the "optin" to "studies" because optin/2 -> what is an optin with the id 2?
|
|
||
| PatientEntry oldEntry = study.getPatientByID(ref, root, ext); | ||
| if (oldEntry == null) { | ||
| throw OptInError.buildError(Status.NOT_FOUND, OptInErrorType.PATIENT_NOT_FOUND, "Patient not found"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do you need OptInError for this? Why not just:
throw new ClientErrorException(Status.NOT_FOUND);| log.log(Level.WARNING, "Cannot update entry, entry does not exist"); | ||
| return Response.status(Status.BAD_REQUEST).entity("Patient*in nicht gefunden").build(); | ||
| } | ||
| PatientEntry newEntry = study.getPatientByID(ref, root, ext); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I still dont get it... It a PUT, its called updateEntry, but all it does it update the comment?
| throw OptInError.buildError(Status.NOT_FOUND, OptInErrorType.PATIENT_NOT_FOUND, "Patient not found"); | ||
| } | ||
| pat.delete(security.getUserPrincipal().getName()); | ||
| return Response.ok().build(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Commonly, NO_CONTENT / 204 is returned if an DELETE is successful
No description provided.