Skip to content

Commit

Permalink
Hlm 4501 smc referral flow (#602)
Browse files Browse the repository at this point in the history
* HLM-4501: Added changes for HFReferral flow

* updated comments for common models

* updated comments for common models removed ini file

This reverts commit c1e226f.

* HLM-4501: updated topics and hfreferal constants

* HLM-4501: updated HFReferralService.java

* HLM-4501: Added changes in project id validator

* HLM-4501: updated HFReferralService.java

* HLM-4501: fixed hfreferral changes

* HLM-4501: added project facility id validator for hf_referral

* HLM-4501: missing link for validator added

* HLM-4501: updated HfrProjectFacilityIdValidator for NPE

* HLM-4501 : updated hf referral symtoms character length to 256

* HLM-4501: updated additionalFields field value size from 2 to 1
  • Loading branch information
kanishq-egov authored Jan 19, 2024
1 parent ce0c5ca commit dee30a1
Show file tree
Hide file tree
Showing 33 changed files with 1,573 additions and 81 deletions.
2 changes: 1 addition & 1 deletion health-services/libraries/health-services-models/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.egov.common</groupId>
<artifactId>health-services-models</artifactId>
<version>1.0.11-SNAPSHOT</version>
<version>1.0.14-SNAPSHOT</version>
<properties>
<maven.compiler.source>8</maven.compiler.source>
<maven.compiler.target>8</maven.compiler.target>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.egov.common.models.facility;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
Expand All @@ -8,9 +11,6 @@
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
* Field
*/
Expand All @@ -30,7 +30,7 @@ public class Field {

@JsonProperty("value")
@NotNull
@Size(min = 2, max = 10000)
@Size(min = 1, max = 10000)
private String value = null;


Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.egov.common.models.household;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
Expand All @@ -8,9 +11,6 @@
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
* Field
*/
Expand All @@ -22,23 +22,16 @@
@AllArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
public class Field {
@JsonProperty("key")
@NotNull


@Size(min=2,max=64)

public class Field {
@JsonProperty("key")
@NotNull
@Size(min = 2, max = 64)
private String key = null;

@JsonProperty("value")
@NotNull


@Size(min=2,max=10000)

@JsonProperty("value")
@NotNull
@Size(min = 1, max = 10000)
private String value = null;


}

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.egov.common.models.individual;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
Expand All @@ -8,9 +11,6 @@
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
* Field
*/
Expand All @@ -22,23 +22,16 @@
@AllArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
public class Field {
@JsonProperty("key")
@NotNull


@Size(min=2,max=64)

public class Field {
@JsonProperty("key")
@NotNull
@Size(min = 2, max = 64)
private String key = null;

@JsonProperty("value")
@NotNull


@Size(min=2,max=10000)

@JsonProperty("value")
@NotNull
@Size(min = 1, max = 10000)
private String value = null;


}

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.egov.common.models.product;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
Expand All @@ -8,9 +11,6 @@
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
* Field
*/
Expand All @@ -22,23 +22,16 @@
@AllArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
public class Field {
@JsonProperty("key")
@NotNull


@Size(min=2,max=64)

public class Field {
@JsonProperty("key")
@NotNull
@Size(min = 2, max = 64)
private String key = null;

@JsonProperty("value")
@NotNull


@Size(min=2,max=10000)

@JsonProperty("value")
@NotNull
@Size(min = 1, max = 10000)
private String value = null;


}

Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
package org.egov.common.models.project;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
Expand All @@ -8,9 +11,6 @@
import lombok.NoArgsConstructor;
import org.springframework.validation.annotation.Validated;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

/**
* Field
*/
Expand All @@ -22,16 +22,16 @@
@AllArgsConstructor
@Builder
@JsonIgnoreProperties(ignoreUnknown = true)
public class Field {

public class Field {
@JsonProperty("key")
@NotNull
@Size(min = 2, max = 64)
private String key = null;

@JsonProperty("value")
@NotNull
@Size(min = 2, max = 10000)
@Size(min = 1, max = 10000)
private String value = null;

}

Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
package org.egov.common.models.referralmanagement.hfreferral;

import java.util.List;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonProperty;
import digit.models.coremodels.AuditDetails;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.egov.common.models.project.AdditionalFields;
import org.egov.common.models.referralmanagement.sideeffect.SideEffect;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class HFReferral {

@JsonProperty("id")
@Size(min = 2, max = 64)
private String id;

@JsonProperty("clientReferenceId")
@Size(min = 2, max = 64)
private String clientReferenceId;

@JsonProperty("tenantId")
@NotNull
@Size(min=2, max = 1000)
private String tenantId;

@JsonProperty("projectId")
@Size(min = 2, max = 64)
private String projectId;

@JsonProperty("projectFacilityId")
@Size(min = 2, max = 64)
private String projectFacilityId;

@JsonProperty("symptom")
@NotNull
@Size(min = 2, max = 256)
private String symptom;

@JsonProperty("symptomSurveyId")
@Size(min = 2, max = 100)
private String symptomSurveyId;

@JsonProperty("beneficiaryId")
@Size(max=100)
private String beneficiaryId;

@JsonProperty("referralCode")
@Size(max=100)
private String referralCode;

@JsonProperty("nationalLevelId")
@Size(max=100)
private String nationalLevelId;

@JsonProperty("isDeleted")
private Boolean isDeleted = Boolean.FALSE;

@JsonProperty("rowVersion")
private Integer rowVersion;

@JsonProperty("auditDetails")
@Valid
private AuditDetails auditDetails;

@JsonProperty("clientAuditDetails")
@Valid
private AuditDetails clientAuditDetails;

@JsonProperty("additionalFields")
@Valid
private AdditionalFields additionalFields;

@JsonIgnore
private Boolean hasErrors = Boolean.FALSE;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
package org.egov.common.models.referralmanagement.hfreferral;

import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import javax.validation.Valid;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;

import com.fasterxml.jackson.annotation.JsonProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.egov.common.contract.request.RequestInfo;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class HFReferralBulkRequest {
@JsonProperty("RequestInfo")
@NotNull
@Valid
private RequestInfo requestInfo;

@JsonProperty("HFReferrals")
@NotNull
@Valid
@Size(min = 1)
private List<HFReferral> hfReferrals;

/**
* Add a HfReferral item to the list of HfReferrals in the bulk request.
*
* @param hfReferralItem The HfReferral item to add to the request.
* @return The updated HFReferralBulkRequest.
*/
public HFReferralBulkRequest addHFReferralItem(HFReferral hfReferralItem) {
if(Objects.isNull(hfReferrals))
hfReferrals = new ArrayList<>();
if(Objects.nonNull(hfReferralItem))
hfReferrals.add(hfReferralItem);
return this;
}
}
Loading

0 comments on commit dee30a1

Please sign in to comment.