Resolve 5483-update-consent-storage-to-latest-spec (#5484)

* removed the adding of memberIdentifier to the consent

* - fixed corresponding test
- added changelog
This commit is contained in:
TynerGjs 2023-11-24 13:40:13 -05:00 committed by GitHub
parent 9f827a75c7
commit d546ce34e5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 5 additions and 14 deletions

View File

@ -0,0 +1,4 @@
---
type: add
issue: 5480
title: "Updated Consent storage in $member-match operation."

View File

@ -133,7 +133,6 @@ public class MemberMatcherR4Helper {
public void updateConsentForMemberMatch( public void updateConsentForMemberMatch(
Consent theConsent, Patient thePatient, Patient theMemberPatient, RequestDetails theRequestDetails) { Consent theConsent, Patient thePatient, Patient theMemberPatient, RequestDetails theRequestDetails) {
addIdentifierToConsent(theConsent, theMemberPatient);
updateConsentPatientAndPerformer(theConsent, thePatient); updateConsentPatientAndPerformer(theConsent, thePatient);
myConsentModifier.accept(theConsent); myConsentModifier.accept(theConsent);
@ -274,13 +273,6 @@ public class MemberMatcherR4Helper {
return policyTypes.equals(CONSENT_POLICY_REGULAR_TYPE) && myRegularFilterSupported; return policyTypes.equals(CONSENT_POLICY_REGULAR_TYPE) && myRegularFilterSupported;
} }
private void addIdentifierToConsent(Consent theConsent, Patient thePatient) {
String consentId = getIdentifier(thePatient).getValue();
Identifier consentIdentifier =
new Identifier().setSystem(CONSENT_IDENTIFIER_CODE_SYSTEM).setValue(consentId);
theConsent.addIdentifier(consentIdentifier);
}
public void setRegularFilterSupported(boolean theRegularFilterSupported) { public void setRegularFilterSupported(boolean theRegularFilterSupported) {
myRegularFilterSupported = theRegularFilterSupported; myRegularFilterSupported = theRegularFilterSupported;
} }

View File

@ -479,7 +479,7 @@ public class MemberMatcherR4HelperTest {
private ArgumentCaptor<Consent> myDaoCaptor; private ArgumentCaptor<Consent> myDaoCaptor;
@Test @Test
public void updateConsentForMemberMatch_noProvider_addsIdentifierUpdatePatientButNotExtensionAndSaves() { public void updateConsentForMemberMatch_noProvider_UpdatePatientButNotExtensionAndSaves() {
// setup // setup
Consent consent = getConsent(); Consent consent = getConsent();
consent.addPolicy(constructConsentPolicyComponent("#sensitive")); consent.addPolicy(constructConsentPolicyComponent("#sensitive"));
@ -493,11 +493,6 @@ public class MemberMatcherR4HelperTest {
verify(myConsentDao).create(myDaoCaptor.capture(), same(myRequestDetails)); verify(myConsentDao).create(myDaoCaptor.capture(), same(myRequestDetails));
Consent saved = myDaoCaptor.getValue(); Consent saved = myDaoCaptor.getValue();
// check consent identifier
assertEquals(1, saved.getIdentifier().size());
assertEquals(MemberMatcherR4Helper.CONSENT_IDENTIFIER_CODE_SYSTEM, saved.getIdentifier().get(0).getSystem());
assertNotNull(saved.getIdentifier().get(0).getValue());
assertEquals(saved.getIdentifier().get(0).getValue(), memberPatient.getIdentifier().get(0).getValue());
// check consent patient info // check consent patient info
String patientRef = patient.getIdElement().toUnqualifiedVersionless().getValue(); String patientRef = patient.getIdElement().toUnqualifiedVersionless().getValue();