From a7da59bea958c2b8b8499a37b78b60d6a139f786 Mon Sep 17 00:00:00 2001 From: Vivek Singh Date: Fri, 12 Apr 2024 13:24:35 +0530 Subject: [PATCH] avniproject/avni-server#714 - provide location uuid in subject response --- .../org/avni/server/web/response/SubjectResponse.java | 2 ++ avni-server-api/src/main/resources/api/external-api.yaml | 8 ++++++++ 2 files changed, 10 insertions(+) diff --git a/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java b/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java index d9005e519..845a75778 100644 --- a/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java +++ b/avni-server-api/src/main/java/org/avni/server/web/response/SubjectResponse.java @@ -70,6 +70,8 @@ private static void putLocation(Individual subject, SubjectResponse subjectRespo addressLevel = addressLevel.getParent(); } subjectResponse.put("location", location); + if (subject.getAddressLevel() != null) + subjectResponse.put("Location ID", subject.getAddressLevel().getUuid()); } private static void putCatchments(Individual subject, SubjectResponse subjectResponse) { diff --git a/avni-server-api/src/main/resources/api/external-api.yaml b/avni-server-api/src/main/resources/api/external-api.yaml index 97d8b2eef..cce0d5829 100644 --- a/avni-server-api/src/main/resources/api/external-api.yaml +++ b/avni-server-api/src/main/resources/api/external-api.yaml @@ -1281,6 +1281,10 @@ components: type: string description: "full hierarchy of location is provided, each one as key-value pair" example: "{\"Village\": \"Ganks\", \"Block\": \"Ynaos\"}" + Location ID: + type: string + format: uuid + description: Unique identifier of the lowest location/address at which the subject is registered relatives: type: array items: @@ -1319,6 +1323,10 @@ components: type: string description: Complete address of the subject example: "India, Uttarakhand, Dehradun" + Location ID: + type: string + format: uuid + description: Unique identifier of the lowest location/address at which the subject is registered Date of birth: type: string description: Applicable only for Person type subject