-
Notifications
You must be signed in to change notification settings - Fork 19
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
Unmask story #306
base: master
Are you sure you want to change the base?
Unmask story #306
Conversation
Veena-tw
commented
Jul 7, 2020
•
edited
Loading
edited
- Unmasks masked reference number to further process discovery and linking of the requests
- Masks PII related information like name, mobile number, etc
"careContexts": [ | ||
{ | ||
"referenceNumber": "NCP1112", | ||
"maskedReferenceNumber": "NCPXXXX", | ||
"display": "National Cancer program" | ||
}, | ||
{ | ||
"referenceNumber": "NCP11122", | ||
"maskedReferenceNumber": "NCPXXXXX", | ||
"display": "National Cancer program - Episode 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.
I would prefer to keep these masked in a different file to not pollute the patients.json.
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.
moved the mapping to maskedReferences.json and removed from demoPatients.json
@@ -12,5 +12,6 @@ public interface IDiscoveryRequestRepository | |||
Task<bool> RequestExistsFor(string requestId, string consentManagerUserId, string patientReferenceNumber); | |||
|
|||
Task<bool> RequestExistsFor(string requestId); |
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.
Task<bool> RequestExistsFor(string requestId); | |
Task<bool> RequestExistsFor(string requestId); | |
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.
done
@@ -20,12 +20,21 @@ public class DiscoveryRequest | |||
public DateTime Timestamp { get; set; } | |||
|
|||
[Required, MaxLength(50)] public string PatientReferenceNumber { get; set; } |
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.
[Required, MaxLength(50)] public string PatientReferenceNumber { get; set; } | |
[Required, MaxLength(50)] public string PatientReferenceNumber { get; set; } | |
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.
done
new ErrorRepresentation(new Error(ErrorCode.DuplicateDiscoveryRequest, "Discovery Request already exists"))); | ||
new ErrorRepresentation(new Error(ErrorCode.DuplicateDiscoveryRequest, | ||
"Discovery Request already exists"))); |
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.
Is it needed?
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 remember you mentioning in another PR that line should not exceed some 80 columns
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.
120's the default column limit. I might have said 80/something whatever is default.
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.
it is at 120.
if (!careContextRepresentations.Any() && | ||
!addToUnlinkedAccounts) |
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 (!careContextRepresentations.Any() && | |
!addToUnlinkedAccounts) | |
if (!careContextRepresentations.Any() && !addToUnlinkedAccounts) |
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.
Modified this.
"Unable to update unlinked care contexts"))); | ||
} | ||
|
||
patient.Identifier = patient.MaskedIdentifier; |
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 mutating 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.
In the discovery response, masked patient identifier is sent back
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.
Same as what I gave for zafar.
"Unable to update unlinked care contexts"))); | ||
} | ||
|
||
patient.Identifier = patient.MaskedIdentifier; |
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 mutating 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.
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 understand the what you are doing, my question is why mutation?
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.
yeah we supposed to keep CM untouched, since they are reading and returning final response from CM, and they are returning reference field not a masked even, they don't even bother about it.
private bool AddToUnlinkedAccounts(IEnumerable<CareContextRepresentation> careContexts, | ||
string patientReferenceNumber) | ||
{ | ||
return linkPatientRepository.SaveUnlinkedAccounts(careContexts, patientReferenceNumber).Result; | ||
} |
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.
What is 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.
Like the way we are storing masked patient reference number in the discovery request, we are storing the masked carecontext reference numbers of the patient in the table called UnlinkedAccounts
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 we need this? lets get on a call.
if (e != null) | ||
{ | ||
Log.Error(e); | ||
//TODO: Handle exception - Zafar |
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.
Both are not pairing?
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.
We are :). One name was enough to track.
b88a640
to
ca01007
Compare
…t reference for further processing - Adds a utility class to mask and unmask references
using System; | ||
using System.Threading.Tasks; | ||
using Discovery; | ||
using Gateway; | ||
using Gateway.Model; | ||
using Hangfire; | ||
using HipLibrary.Patient.Model; | ||
using Logger; | ||
using Microsoft.AspNetCore.Mvc; | ||
using Microsoft.AspNetCore.Authorization; | ||
using static Common.Constants; | ||
using static Constants; |
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.
Its not supposed to be changed. using inside is the convention.
…t reference for further processing - Adds a utility class to mask and unmask references
<ItemGroup> | ||
<Content Include="Resources\NCP1007DiagnosticReportDocument.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>Always</CopyToPublishDirectory> | ||
<Link>NCP1007DiagnosticReportDocument.json</Link> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="Resources\NCP1007PrescriptionDocument1.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>Always</CopyToPublishDirectory> | ||
<Link>NCP1007PrescriptionDocument1.json</Link> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="Resources\NCP1007PrescriptionDocument2.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>Always</CopyToPublishDirectory> | ||
<Link>NCP1007PrescriptionDocument2.json</Link> | ||
</Content> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Content Include="Resources\NCP1007PrescriptionDocument3.json"> | ||
<CopyToOutputDirectory>Always</CopyToOutputDirectory> | ||
<CopyToPublishDirectory>Always</CopyToPublishDirectory> | ||
<Link>NCP1007PrescriptionDocument3.json</Link> | ||
</Content> | ||
</ItemGroup> |
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.
Is it required?
…t reference for further processing - Adds a utility class to mask and unmask references
…t reference for further processing - Adds a utility class to mask and unmask references
…t reference for further processing - Adds masking of PII information
Here is an overview of what got changed by this pull request: Complexity increasing per file
==============================
- src/In.ProjectEKA.DefaultHip/Patient/MaskingUtility.cs 3
Clones added
============
- test/In.ProjectEKA.HipServiceTest/Discovery/PatientDiscoveryTest.cs 4
Clones removed
==============
+ src/In.ProjectEKA.HipService/Discovery/Database/Migrations/DiscoveryContextModelSnapshot.cs -1
See the complete overview on Codacy |