diff --git a/backend/src/main/java/com/Adapter/icare/Dtos/IdentifierDTO.java b/backend/src/main/java/com/Adapter/icare/Dtos/IdentifierDTO.java index 73bbba70..f620a13b 100644 --- a/backend/src/main/java/com/Adapter/icare/Dtos/IdentifierDTO.java +++ b/backend/src/main/java/com/Adapter/icare/Dtos/IdentifierDTO.java @@ -17,7 +17,7 @@ public class IdentifierDTO { private String id; @NotNull private String type; - private String use; + private boolean preferred; private String system; private FacilityDetailsDTO organization; diff --git a/backend/src/main/java/com/Adapter/icare/Dtos/PatientDTO.java b/backend/src/main/java/com/Adapter/icare/Dtos/PatientDTO.java index fd9a51af..a0895a83 100644 --- a/backend/src/main/java/com/Adapter/icare/Dtos/PatientDTO.java +++ b/backend/src/main/java/com/Adapter/icare/Dtos/PatientDTO.java @@ -87,7 +87,7 @@ public DemographicDetailsDTO toMap() { IdentifierDTO identifierDTO = new IdentifierDTO(); identifierDTO.setId(identifier.hasValue() ? identifier.getValue(): this.getId()); identifierDTO.setType(identifier.hasType() ? identifier.getType().getCoding().get(0).getCode(): null); - identifierDTO.setUse( identifier.hasUse() ? identifier.getUse().getDisplay(): null); + identifierDTO.setPreferred(identifier.hasUse() && (identifier.getUse().getDisplay().equals("official"))); identifierDTO.setSystem(identifier.hasSystem() ? identifier.getSystem(): null); idsList.add(identifierDTO); } diff --git a/backend/src/main/java/com/Adapter/icare/Organisations/Dtos/OrganizationDTO.java b/backend/src/main/java/com/Adapter/icare/Organisations/Dtos/OrganizationDTO.java index ca04db61..aeb9a182 100644 --- a/backend/src/main/java/com/Adapter/icare/Organisations/Dtos/OrganizationDTO.java +++ b/backend/src/main/java/com/Adapter/icare/Organisations/Dtos/OrganizationDTO.java @@ -40,7 +40,7 @@ public Map toMap() { IdentifierDTO identifierDTO = new IdentifierDTO(); identifierDTO.setId(identifier.getIdElement().getId()); identifierDTO.setType(identifier.getType().getText()); - identifierDTO.setUse(identifier.getUse().getDisplay()); + identifierDTO.setPreferred(identifier.hasUse() && (identifier.getUse().getDisplay().equals("official"))); identifierDTOs.add(identifierDTO); } } diff --git a/backend/src/main/java/com/Adapter/icare/SharedHealthRecords/Services/SharedHealthRecordsService.java b/backend/src/main/java/com/Adapter/icare/SharedHealthRecords/Services/SharedHealthRecordsService.java index c3dfc465..afff4ef3 100644 --- a/backend/src/main/java/com/Adapter/icare/SharedHealthRecords/Services/SharedHealthRecordsService.java +++ b/backend/src/main/java/com/Adapter/icare/SharedHealthRecords/Services/SharedHealthRecordsService.java @@ -220,7 +220,7 @@ public Map getSharedRecordsWithPagination(Integer page, Integer CareServiceDTO careServiceDTO = new CareServiceDTO(); if (careServiceObs.hasComponent() && !careServiceObs.getComponent().isEmpty()) { Observation.ObservationComponentComponent careTypeComponent = careServiceObs.getComponent().get(0); - if (careTypeComponent != null && careTypeComponent.hasValueStringType() && careTypeComponent.getValueBooleanType().hasValue()) { + if (careTypeComponent != null && careTypeComponent.hasValueStringType() && careTypeComponent.getValueStringType().hasValue()) { careServiceDTO.setCareType(careTypeComponent.getValueStringType().getValueAsString()); } if (careServiceObs.getComponent().size() > 1) {