From 00f2b86c2bcfe2af9d57fc89e763ef062cdb4146 Mon Sep 17 00:00:00 2001 From: Reham Muzzamil Date: Fri, 24 Feb 2023 15:37:21 +0500 Subject: [PATCH] 2060: Remove KeycloakUserDetails from the PractitionerDetails Response Paylaod --- pom.xml | 2 +- .../practitioner/KeycloakUserDetails.java | 81 --------- .../practitioner/PractitionerDetails.java | 25 --- .../model/practitioner/UserBioData.java | 170 ------------------ 4 files changed, 1 insertion(+), 277 deletions(-) delete mode 100755 src/main/java/org/smartregister/model/practitioner/KeycloakUserDetails.java delete mode 100755 src/main/java/org/smartregister/model/practitioner/UserBioData.java diff --git a/pom.xml b/pom.xml index f38e61c..8c5821a 100755 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ org.smartregister fhir-common-utils - 0.0.5-SNAPSHOT + 0.0.6-SNAPSHOT diff --git a/src/main/java/org/smartregister/model/practitioner/KeycloakUserDetails.java b/src/main/java/org/smartregister/model/practitioner/KeycloakUserDetails.java deleted file mode 100755 index 3c4c908..0000000 --- a/src/main/java/org/smartregister/model/practitioner/KeycloakUserDetails.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright 2021 Ona Systems, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.smartregister.model.practitioner; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.util.ElementUtil; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Type; - -import java.util.List; - -@DatatypeDef(name = "KeycloakUserDetails") -public class KeycloakUserDetails extends Type implements ICompositeType { - @Child( - name = "user-bio", - type = {StringType.class}, - order = 0, - min = 0, - max = -1, - modifier = false, - summary = false) - private UserBioData userBioData; - - @Child( - name = "user-roles", - type = {StringType.class}, - order = 1, - min = 0, - max = -1, - modifier = false, - summary = false) - private List roles; - - public UserBioData getUserBioData() { - return userBioData; - } - - public void setUserBioData(UserBioData userBioData) { - this.userBioData = userBioData; - } - - public List getRoles() { - return roles; - } - - public void setRoles(List roles) { - this.roles = roles; - } - - @Override - public Type copy() { - KeycloakUserDetails keycloakUserDetails = new KeycloakUserDetails(); - copyValues(keycloakUserDetails); - return keycloakUserDetails; - } - - @Override - public boolean isEmpty() { - return ElementUtil.isEmpty(userBioData); - } - - @Override - protected Type typedCopy() { - return copy(); - } -} diff --git a/src/main/java/org/smartregister/model/practitioner/PractitionerDetails.java b/src/main/java/org/smartregister/model/practitioner/PractitionerDetails.java index 9b41dbd..19af5ed 100755 --- a/src/main/java/org/smartregister/model/practitioner/PractitionerDetails.java +++ b/src/main/java/org/smartregister/model/practitioner/PractitionerDetails.java @@ -33,14 +33,6 @@ profile = "http://hl7.org/fhir/profiles/custom-resource") public class PractitionerDetails extends Practitioner { - @Child( - name = "KeycloakUserDetails", - type = {KeycloakUserDetails.class}) - @Description( - shortDefinition = "Get Keycloak User details from the Keycloak server", - formalDefinition = "Get Keycloak User details from the Keycloak server") - private KeycloakUserDetails keycloakUserDetails; - @Child( name = "fhir", type = {FhirPractitionerDetails.class}) @@ -58,15 +50,6 @@ public class PractitionerDetails extends Practitioner { public static final String SP_KEYCLOAK_UUID = "keycloak-uuid"; public static final TokenClientParam KEYCLOAK_UUID = new TokenClientParam("keycloak-uuid"); - @SearchParamDefinition( - name = "isAuthProvided", - path = "PractitionerDetails.isAuthProvided", - description = "isAuthProvided", - type = "token" - ) - - public static final String SP_IS_AUTH_PROVIDED = "isAuthProvided"; - public static final SpecialParam IS_AUTH_PROVIDED = new SpecialParam().setValue("isAuthProvided"); @Override public Practitioner copy() { Practitioner practitioner = new Practitioner(); @@ -85,14 +68,6 @@ public ResourceType getResourceType() { return ResourceType.Bundle; } - public KeycloakUserDetails getUserDetail() { - return keycloakUserDetails; - } - - public void setUserDetail(KeycloakUserDetails keycloakUserDetails) { - this.keycloakUserDetails = keycloakUserDetails; - } - public FhirPractitionerDetails getFhirPractitionerDetails() { return fhirPractitionerDetails; } diff --git a/src/main/java/org/smartregister/model/practitioner/UserBioData.java b/src/main/java/org/smartregister/model/practitioner/UserBioData.java deleted file mode 100755 index afc626d..0000000 --- a/src/main/java/org/smartregister/model/practitioner/UserBioData.java +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright 2021 Ona Systems, Inc - * - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License. - */ -package org.smartregister.model.practitioner; - -import ca.uhn.fhir.model.api.annotation.Child; -import ca.uhn.fhir.model.api.annotation.DatatypeDef; -import ca.uhn.fhir.util.ElementUtil; -import org.hl7.fhir.instance.model.api.ICompositeType; -import org.hl7.fhir.r4.model.StringType; -import org.hl7.fhir.r4.model.Type; - -@DatatypeDef(name = "user-bio") -public class UserBioData extends Type implements ICompositeType { - - @Child( - name = "identifier", - type = {StringType.class}, - order = 0, - min = 1, - max = 1, - modifier = false, - summary = false) - protected StringType identifier; - - @Child( - name = "userName", - type = {StringType.class}, - order = 1, - min = 1, - max = 1, - modifier = false, - summary = false) - protected StringType userName; - - @Child( - name = "preferredName", - type = {StringType.class}, - order = 2, - min = 1, - max = 1, - modifier = false, - summary = false) - protected StringType preferredName; - - @Child( - name = "familyName", - type = {StringType.class}, - order = 3, - min = 1, - max = 1, - modifier = false, - summary = false) - protected StringType familyName; - - @Child( - name = "givenName", - type = {StringType.class}, - order = 4, - min = 1, - max = 1, - modifier = false, - summary = false) - protected StringType givenName; - - @Child( - name = "email", - type = {StringType.class}, - order = 5, - min = 1, - max = 1, - modifier = false, - summary = false) - protected StringType email; - - @Child( - name = "emailVerified", - type = {StringType.class}, - order = 6, - min = 1, - max = 1, - modifier = false, - summary = false) - protected StringType emailVerified; - - public StringType getIdentifier() { - return identifier; - } - - public void setIdentifier(StringType identifier) { - this.identifier = identifier; - } - - public StringType getUserName() { - return userName; - } - - public void setUserName(StringType userName) { - this.userName = userName; - } - - public StringType getPreferredName() { - return preferredName; - } - - public void setPreferredName(StringType preferredName) { - this.preferredName = preferredName; - } - - public StringType getFamilyName() { - return familyName; - } - - public void setFamilyName(StringType familyName) { - this.familyName = familyName; - } - - public StringType getGivenName() { - return givenName; - } - - public void setGivenName(StringType givenName) { - this.givenName = givenName; - } - - public StringType getEmail() { - return email; - } - - public void setEmail(StringType email) { - this.email = email; - } - - public StringType getEmailVerified() { - return emailVerified; - } - - public void setEmailVerified(StringType emailVerified) { - this.emailVerified = emailVerified; - } - - @Override - public Type copy() { - UserBioData userBioData = new UserBioData(); - copyValues(userBioData); - return userBioData; - } - - @Override - public boolean isEmpty() { - return ElementUtil.isEmpty(identifier); - } - - @Override - protected Type typedCopy() { - return copy(); - } -}