Repository navigation
Stop 639 #380
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
Stop 639 #380
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -25,6 +25,8 @@ | |
|
|
||
| import java.sql.Timestamp; | ||
| import java.time.LocalDate; | ||
| import java.util.ArrayList; | ||
| import java.util.Arrays; | ||
| import java.util.Collections; | ||
| import java.util.HashSet; | ||
| import java.util.List; | ||
|
|
@@ -102,6 +104,7 @@ public String save(List<TBConfirmedCaseDTO> request, String authorisation) throw | |
| entity.setPlaceOfDeath(dto.getPlaceOfDeath()); | ||
| entity.setReasonForDeath(dto.getReasonForDeath()); | ||
| entity.setReasonForNotCompleting(dto.getReasonForNotCompleting()); | ||
| if (dto.getSideEffects() != null) entity.setSideEffects(joinSideEffects(dto.getSideEffects())); | ||
| // Stop TB / Nikshay reporting — same gap as tb_suspected: benRegID is computed | ||
| // above for the visit lookup but was never persisted onto the entity. | ||
| entity.setBenRegID(beneficiaryRegID); | ||
|
|
@@ -251,7 +254,23 @@ private TBConfirmedCaseDTO toDTO(TBConfirmedCase entity) { | |
| dto.setReasonForNotCompleting(entity.getReasonForNotCompleting()); | ||
| dto.setUpdateDate(entity.getLastModDate()); | ||
| dto.setUpdatedBy(entity.getModifiedBy()); | ||
| dto.setSideEffects(splitSideEffects(entity.getSideEffects())); | ||
|
|
||
| return dto; | ||
| } | ||
|
|
||
| private String joinSideEffects(List<String> sideEffects) { | ||
| return sideEffects.stream() | ||
| .filter(s -> s != null && !s.isBlank()) | ||
| .map(String::trim) | ||
| .collect(Collectors.joining(",")); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | 🏗️ Heavy lift Preserve commas within side-effect entries. If a request contains 🤖 Prompt for AI Agents
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not required There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @chetansaroya Understood. I won’t pursue this change. You are interacting with an AI system. |
||
| } | ||
|
|
||
| private List<String> splitSideEffects(String sideEffects) { | ||
| if (sideEffects == null) return new ArrayList<>(); | ||
| return Arrays.stream(sideEffects.split(",")) | ||
| .map(String::trim) | ||
| .filter(s -> !s.isEmpty()) | ||
| .collect(Collectors.toList()); | ||
| } | ||
| } | ||
Uh oh!
There was an error while loading. Please reload this page.
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.
🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: PSMRI/FLW-API
Length of output: 3177
🏁 Script executed:
Repository: PSMRI/FLW-API
Length of output: 12552
🏁 Script executed:
Repository: PSMRI/FLW-API
Length of output: 404
🏁 Script executed:
Repository: PSMRI/FLW-API
Length of output: 1062
Exclude
sideEffectsfrom request logging.@DatageneratestoString()forTBConfirmedCaseDTO, sosideEffectsis included. Both save logs stringify the request: the controller logsTBConfirmedRequestDTO, whose list contains these DTOs, and the service logs the DTO list directly.Existing fields already expose treatment, adherence, discomfort, outcome, and death information. This change adds
sideEffectsto that existing medical-data exposure. Remove it from the logged representation or log a redacted request.🤖 Prompt for AI Agents
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 required
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.
@chetansaroya Understood. I won’t pursue this change.
You are interacting with an AI system.