Skip to content

Commit

Permalink
Merge pull request #674 from egovernments/HLM-5075-update-search-acro…
Browse files Browse the repository at this point in the history
…ss-services

Hlm 5075 update search across services
  • Loading branch information
kanishq-egov authored Mar 20, 2024
2 parents ab68988 + f9b50ac commit 3d452ab
Show file tree
Hide file tree
Showing 55 changed files with 238 additions and 143 deletions.
7 changes: 0 additions & 7 deletions build/build-config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ config:
dockerfile: "build/maven/Dockerfile"
- work-dir: "health-services/individual/src/main/resources/db"
image-name: "health-individual-db"
- name: "builds/health-campaign-services/health-services/health-attendance"
build:
- work-dir: "health-services/attendance"
image-name: "health-attendance"
dockerfile: "build/maven/Dockerfile"
- work-dir: "health-services/attendance/src/main/resources/db"
image-name: "health-attendance-db"
- name: "builds/health-campaign-services/health-services/household"
build:
- work-dir: "health-services/household"
Expand Down
30 changes: 22 additions & 8 deletions docs/health-api-specs/contracts/project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1438,12 +1438,16 @@ definitions:
clientReferenceId:
$ref: '#/definitions/clientReferenceIdForSearch'
projectId:
type: string
type: array
items:
type: string
minLength: 2
maxLength: 64
description: Unique ID form Project
beneficiaryId:
type: string
type: array
items:
type: string
minLength: 2
maxLength: 64
description: Unique ID of Household/Individual being added as beneficiary
Expand Down Expand Up @@ -1533,13 +1537,17 @@ definitions:
clientReferenceId:
$ref: '#/definitions/clientReferenceIdForSearch'
projectId:
type: string
type: array
items:
type: string
minLength: 2
maxLength: 64
description: Unique ProjectId
projectBeneficiaryId:
type: string
example: "R-ID-1"
type: array
items:
type: string
example: "R-ID-1"
plannedStartDate:
type: integer
format: int64
Expand Down Expand Up @@ -1622,12 +1630,16 @@ definitions:
id:
$ref: '#/definitions/idForSearch'
staffId:
type: string
type: array
items:
type: string
description: Unique userId defined using user service
minLength: 2
maxLength: 64
projectId:
type: string
type: array
items:
type: string
description: Project Id
minLength: 2
maxLength: 64
Expand Down Expand Up @@ -1730,7 +1742,9 @@ definitions:
id:
$ref: '#/definitions/idForSearch'
projectId:
type: string
type: array
items:
type: string
description: Unique Project Id defined in Project Service
minLength: 2
maxLength: 64
Expand Down
10 changes: 7 additions & 3 deletions docs/health-api-specs/contracts/referral-management.yml
Original file line number Diff line number Diff line change
Expand Up @@ -542,13 +542,17 @@ definitions:
clientReferenceId:
$ref: '#/definitions/clientReferenceIdForSearch'
taskId:
type: string
type: array
items:
type: string
minLength: 2
maxLength: 64
description: Unique TaskId
taskClientReferenceId:
type: string
example: R-ID-1
type: array
items:
type: string
example: R-ID-1
SideEffectSearchRequest:
type: object
properties:
Expand Down
12 changes: 9 additions & 3 deletions docs/health-api-specs/contracts/registries/individual.yml
Original file line number Diff line number Diff line change
Expand Up @@ -448,7 +448,10 @@ definitions:
type: object
properties:
individualId:
$ref: '#/definitions/individualId'
# $ref: '#/definitions/individualId'
type: array
items:
type: string
id:
$ref: '#/definitions/idForSearch'
clientReferenceId:
Expand All @@ -460,9 +463,12 @@ definitions:
gender:
$ref: '#/definitions/gender'
mobileNumber:
type: string
type: array
items:
type: string
maxLength: 20
description: Mobile number of the user
maxLength: 20

socialCategory:
type: string
description: Social category of the user
Expand Down
22 changes: 15 additions & 7 deletions docs/health-api-specs/contracts/registries/product.yml
Original file line number Diff line number Diff line change
Expand Up @@ -311,13 +311,19 @@ definitions:
description: Define the type of product
example: 'DRUG'
name:
type: string
type: array
items:
type: string
example: Paracetamol
description: Capture name of the product
example: Paracetamol

manufacturer:
type: string
type: array
items:
type: string
example: 'J&J'
description: Capture manufacturer of product
example: 'J&J'


ProductVariant:
type: object
Expand Down Expand Up @@ -368,9 +374,11 @@ definitions:
id:
$ref: '#/definitions/idForSearch'
productId:
type: string
minLength: 2
maxLength: 64
type: array
items:
type: string
minLength: 2
maxLength: 64
description: Product for which this variant is being created
sku:
type: string
Expand Down
22 changes: 17 additions & 5 deletions docs/health-api-specs/contracts/stock.yml
Original file line number Diff line number Diff line change
Expand Up @@ -589,7 +589,10 @@ definitions:
facilityId:
$ref: '#/definitions/facilityId'
productVariantId:
$ref: '#/definitions/productVariantId'
# $ref: '#/definitions/productVariantId'
type: array
items:
type: string
referenceId:
$ref: '#/definitions/referenceId'
referenceIdType:
Expand All @@ -603,8 +606,10 @@ definitions:
transactingPartyType:
$ref: '#/definitions/transactingPartyType'
wayBillNumber:
$ref: '#/definitions/wayBillNumber'

# $ref: '#/definitions/wayBillNumber'
type: array
items:
type: string
StockReconciliation:
type: object
required:
Expand Down Expand Up @@ -657,9 +662,16 @@ definitions:
clientReferenceId:
$ref: '#/definitions/clientReferenceIdForSearch'
facilityId:
$ref: '#/definitions/facilityId'
# $ref: '#/definitions/facilityId'
type: array
items:
type: string
example: FacilityA
productVariantId:
$ref: '#/definitions/productVariantId'
# $ref: '#/definitions/productVariantId'
type: array
items:
type: string


StockRequest:
Expand Down
2 changes: 1 addition & 1 deletion health-services/facility/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>org.egov.common</groupId>
<artifactId>health-services-models</artifactId>
<version>1.0.7-SNAPSHOT</version>
<version>1.0.15-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
4 changes: 4 additions & 0 deletions health-services/household/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
All notable changes to this module will be documented in this file.

## To be released
- The following field were updated to accept list of search entities instead of single entity in HouseholdMemberSearch:
- householdId, householdClientReferenceId, individualId, and individualClientReferenceId

## 1.1.1 - 2023-11-15

- Added total count for household
Expand Down
8 changes: 8 additions & 0 deletions health-services/household/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,11 @@ Household service APIs - contains create, update, delete and search end point
## Pre commit script

[commit-msg](https://gist.github.com/jayantp-egov/14f55deb344f1648503c6be7e580fa12)

## Updates
- Household Member Search
- `householdId`, `householdClientReferenceId`, `individualId`, and `individualClientReferenceId` now accepts a list of entities instead of single entity to search household member
## Usage
- Start the service
- Access the API endpoints for searching `household member`
- Pass list parameters for the search fields mentioned in updates
2 changes: 1 addition & 1 deletion health-services/household/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>org.egov.common</groupId>
<artifactId>health-services-models</artifactId>
<version>1.0.11-SNAPSHOT</version>
<version>1.0.15-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
4 changes: 4 additions & 0 deletions health-services/individual/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
All notable changes to this module will be documented in this file.


## To be released
- In IndividualSearch, individualId, mobileNumber updated to accept list of search entities instead of single entity

## 1.1.3
- Added ability to search by user UUID for individual search.

Expand Down
8 changes: 8 additions & 0 deletions health-services/individual/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,11 @@ g) POST `/individual/v1/_search` - Search Individual, This API is internally cal
## Pre commit script

[commit-msg](https://gist.github.com/jayantp-egov/14f55deb344f1648503c6be7e580fa12)

## Updates
- Individual Search
- `individualId`, and `mobileNumber` now accepts a list of entities instead of single entity to search individual
## Usage
- Start the service
- Access the API endpoints for searching `individual`
- Pass list parameters for the search fields mentioned in updates
2 changes: 1 addition & 1 deletion health-services/individual/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
<dependency>
<groupId>org.egov.common</groupId>
<artifactId>health-services-models</artifactId>
<version>1.0.9-SNAPSHOT</version>
<version>1.0.15-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,13 +269,14 @@ private String getQueryForIndividual(IndividualSearch searchObject, Integer limi
query = query + "AND userId=:userId ";
paramsMap.put("userId", String.valueOf(searchObject.getUserId()));
}

if (searchObject.getUserUuid() != null) {
query = query + "AND userUuid in (:userUuid) ";
paramsMap.put("userUuid", searchObject.getUserUuid());
}

query = query + "ORDER BY id ASC LIMIT :limit OFFSET :offset";

query = query + "ORDER BY createdtime DESC LIMIT :limit OFFSET :offset";

paramsMap.put("tenantId", tenantId);
paramsMap.put("isDeleted", includeDeleted);
paramsMap.put("lastModifiedTime", lastChangedSince);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public class IndividualSearch {
private List<String> id = null;

@JsonProperty("individualId")
private String individualId = null;
private List<String> individualId = null;

@JsonProperty("clientReferenceId")
private List<String> clientReferenceId = null;
Expand All @@ -57,7 +57,7 @@ public class IndividualSearch {
private Gender gender = null;

@JsonProperty("mobileNumber")
private String mobileNumber = null;
private List<String> mobileNumber = null;

@JsonProperty("socialCategory")
@Exclude
Expand Down Expand Up @@ -94,11 +94,11 @@ public class IndividualSearch {

@Exclude
@JsonProperty("username")
private String username;
private List<String> username;

@Exclude
@JsonProperty("userId")
private Long userId;
private List<Long> userId;

@Exclude
@JsonProperty("userUuid")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,19 @@ public class HouseholdMemberSearch {
private List<String> id = null;

@JsonProperty("householdId")
private String householdId = null;
private List<String> householdId = null;

@JsonProperty("householdClientReferenceId")
private String householdClientReferenceId = null;
private List<String> householdClientReferenceId = null;

@JsonProperty("individualId")
private String individualId = null;
private List<String> individualId = null;

@JsonProperty("clientReferenceId")
private List<String> clientReferenceId = null;

@JsonProperty("individualClientReferenceId")
private String individualClientReferenceId = null;
private List<String> individualClientReferenceId = null;

@JsonProperty("isHeadOfHousehold")
private Boolean isHeadOfHousehold = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class IndividualSearch {
private List<String> id = null;

@JsonProperty("individualId")
private String individualId = null;
private List<String> individualId = null;

@JsonProperty("clientReferenceId")
private List<String> clientReferenceId = null;
Expand All @@ -51,7 +51,7 @@ public class IndividualSearch {
private Gender gender = null;

@JsonProperty("mobileNumber")
private String mobileNumber = null;
private List<String> mobileNumber = null;

@JsonProperty("socialCategory")
private String socialCategory = null;
Expand Down Expand Up @@ -79,10 +79,10 @@ public class IndividualSearch {
private List<String> roleCodes = null;

@JsonProperty("username")
private String username;
private List<String> username;

@JsonProperty("userId")
private Long userId;
private List<Long> userId;

@JsonProperty("userUuid")
@Size(min = 1)
Expand Down
Loading

0 comments on commit 3d452ab

Please sign in to comment.