Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
341a34f
Enforced mandatory validation for "Reason for Refusal in section e in…
sehjotsinghunthinkable Jun 22, 2026
2908c20
Added counselled flag to confirmed cases response, indicating whether…
sehjotsinghunthinkable Jun 23, 2026
9396905
Align `/complete` and `/submitBulk` form response editing behavior
sehjotsinghunthinkable Jun 23, 2026
9e28141
Merge branch 'vb/counselling' into vb/counselling
sehjotsinghunthinkable Jun 23, 2026
105ede6
Add van/sync tracking fields (vanID, parkingPlaceID, vanSerialNo, pro…
sehjotsinghunthinkable Jun 24, 2026
21b7187
feat(dynamic-form): add Hindi localization fields and completed benef…
sehjotsinghunthinkable Jun 25, 2026
fdb1a1f
feat(dynamic-form): add Hindi localization fields and completed benef…
sehjotsinghunthinkable Jun 25, 2026
6d8cb0b
Merge branch 'vb/counselling' into vb/counselling
vishwab1 Jun 25, 2026
5f05f66
feat(beneficiary): expose GPS coordinates in getBeneficiaryData response
sehjotsinghunthinkable Jun 26, 2026
6ae9ed0
Committed 82b00ccf with only the three files:
sehjotsinghunthinkable Jun 26, 2026
0332e9b
Revert "Committed 82b00ccf with only the three files:"
sehjotsinghunthinkable Jun 26, 2026
4123985
Committed 82b00ccf with only the three files:
sehjotsinghunthinkable Jun 26, 2026
b7488fe
Committed 82b00ccf with only the three files:
sehjotsinghunthinkable Jun 26, 2026
78d402c
Merge branch 'vb/counselling' into vb/counselling
sehjotsinghunthinkable Jun 26, 2026
b92cdea
Updated isMandatory field in Section C, so changed in TbCounsellingFo…
sehjotsinghunthinkable Jun 30, 2026
81e29d2
Add optional villageId and providerServiceMapId filters to getComplet…
sehjotsinghunthinkable Jul 2, 2026
be0d0d6
Removing section f from seeder
sehjotsinghunthinkable Jul 2, 2026
f6aca3a
Removing already existing check in /complete api
sehjotsinghunthinkable Jul 2, 2026
41550c2
Add a CHECKBOX question type and a TB_COUNSELLING_V2 seeder with a GE…
sehjotsinghunthinkable Jul 5, 2026
380014c
Seed single-checkbox questions for Sections A-D and point the Counsel…
sehjotsinghunthinkable Jul 6, 2026
4aafc4b
Mark form/section status REFUSED when TB2_GI_Q1=NO on /complete, spli…
sehjotsinghunthinkable Jul 6, 2026
b4bc4e0
Resolved conflicts
sehjotsinghunthinkable Jul 7, 2026
c53b9b5
fix(stoptb): getBeneficiaryData reads anthropometry/vitals from stand…
vishwab1 Jun 30, 2026
c7806cf
fix(compile): rename variable 'a' to 'anthro' to avoid conflict with …
vishwab1 Jun 30, 2026
d8008c3
fix(stoptb): set CreatedDate on t_benvisitdetail insert to prevent NO…
vishwab1 Jun 30, 2026
095f0ae
fix(anc-pnc): guard CreatedDate on BenVisitDetail insert for ANC and …
vishwab1 Jun 30, 2026
3b3a4c5
fix(docker): set TZ=Asia/Kolkata to prevent UTC/IST date mismatch
vishwab1 Jul 1, 2026
b1d28ae
fix(stoptb): handle ISO 8601 Z suffix in parseDob to fix beneficiary …
vishwab1 Jul 1, 2026
6d92f74
fix(stoptb): fallback to i_ben_flow_outreach.ben_dob when i_beneficia…
vishwab1 Jul 1, 2026
7459c47
fix: use saveAndFlush to prevent FK violation in t_benchiefcomplaint
vishwab1 Jul 1, 2026
9fccf6f
fix(stoptb): compute age from benDetailsRMNCH_OBJ.dob instead of benD…
vishwab1 Jul 3, 2026
7ddde0a
fix(stoptb): scope Suspected/Confirmed getAll by facility+village ins…
vishwab1 Jul 3, 2026
33c4f4d
fix(stoptb): drop date filter from facility-scoped Suspected query
vishwab1 Jul 3, 2026
349e714
fix(stoptb): join facility-scoped query on beneficiaryID, not benefic…
vishwab1 Jul 3, 2026
4d6606e
Added counselled flag to confirmed cases response, indicating whether…
sehjotsinghunthinkable Jun 23, 2026
33219a1
Revert "Committed 82b00ccf with only the three files:"
sehjotsinghunthinkable Jun 26, 2026
6951221
Committed 82b00ccf with only the three files:
sehjotsinghunthinkable Jun 26, 2026
e9fd699
Merge branch 'vb/counselling' into vb/counselling
vishwab1 Jul 7, 2026
5df6584
Integrated diagnostic device (X-ray/CAD/Trunat) results and document …
sehjotsinghunthinkable Jul 15, 2026
e8e67cd
Merge branch 'vb/trace' into feature/device-integration
sehjotsinghunthinkable Jul 15, 2026
078747a
feat(stoptb): return visitCode in save responses for ABDM M2 flow
vishwab1 Jul 17, 2026
b74654d
feat(stoptb): return visitCode in general exam/screening/OPD get resp…
vishwab1 Jul 17, 2026
20ed063
● Add TrueNat TB/drug-resistance classification, split XRAY/TrueNat p…
sehjotsinghunthinkable Jul 17, 2026
841867e
Making changes in common_example.properties
sehjotsinghunthinkable Jul 17, 2026
8b05cc3
Feature/device integration (#288)
sehjotsinghunthinkable Jul 17, 2026
c940bfc
Added api for listing of beneficiaries id according to diagnostic ord…
sehjotsinghunthinkable Jul 19, 2026
3c9db88
Merge branch 'vb/visit' into feature/device-integration
sehjotsinghunthinkable Jul 19, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions src/main/environment/common_ci.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,3 +40,25 @@ sms-password=@env.SMS_PASSWORD@
send-message-url=@env.SMS_MESSAGE_URL@

#crash.logs.base.path=@env.CRASH_LOGS_PATH@

# ── Diagnostic Device Integration ────────────────────────────────────────────
# diagnostic.active-provider must be one of com.iemr.flw.masterEnum.DiagnosticProviderCode (currently: EMRLITE)
diagnostic.active-provider=@env.DIAGNOSTIC_ACTIVE_PROVIDER@

diagnostic.emrlite.base-url=@env.DIAGNOSTIC_EMRLITE_BASE_URL@
diagnostic.emrlite.login-url=${diagnostic.emrlite.base-url}/api/v1/integrations/login/
diagnostic.emrlite.refresh-url=${diagnostic.emrlite.base-url}/api/v1/integrations/getAccessToken/
diagnostic.emrlite.order-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/
diagnostic.emrlite.result-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/result/
diagnostic.emrlite.username=@env.DIAGNOSTIC_EMRLITE_USERNAME@
diagnostic.emrlite.password=@env.DIAGNOSTIC_EMRLITE_PASSWORD@
diagnostic.emrlite.token-ttl-seconds=@env.DIAGNOSTIC_EMRLITE_TOKEN_TTL_SECONDS@
diagnostic.emrlite.refresh-ttl-seconds=@env.DIAGNOSTIC_EMRLITE_REFRESH_TTL_SECONDS@

diagnostic.poll.xray.tick-ms=@env.DIAGNOSTIC_POLL_XRAY_TICK_MS@
diagnostic.poll.give-up-minutes=@env.DIAGNOSTIC_POLL_GIVE_UP_MINUTES@
diagnostic.poll.interval-seconds=@env.DIAGNOSTIC_POLL_INTERVAL_SECONDS@
diagnostic.poll.truenat.initial-delay-minutes=@env.DIAGNOSTIC_POLL_TRUENAT_INITIAL_DELAY_MINUTES@
diagnostic.poll.truenat.tick-ms=@env.DIAGNOSTIC_POLL_TRUENAT_TICK_MS@

diagnostic.documents.storage-root=@env.DIAGNOSTIC_DOCUMENTS_STORAGE_ROOT@
21 changes: 21 additions & 0 deletions src/main/environment/common_docker.properties
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,26 @@ send-message-url=${SMS_MESSAGE_URL}

#crash.logs.base.path=${CRASH_LOGS_PATH}

# ── Diagnostic Device Integration ────────────────────────────────────────────
# diagnostic.active-provider must be one of com.iemr.flw.masterEnum.DiagnosticProviderCode (currently: EMRLITE)
diagnostic.active-provider=${DIAGNOSTIC_ACTIVE_PROVIDER}

diagnostic.emrlite.base-url=${DIAGNOSTIC_EMRLITE_BASE_URL}
diagnostic.emrlite.login-url=${diagnostic.emrlite.base-url}/api/v1/integrations/login/
diagnostic.emrlite.refresh-url=${diagnostic.emrlite.base-url}/api/v1/integrations/getAccessToken/
diagnostic.emrlite.order-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/
diagnostic.emrlite.result-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/result/
diagnostic.emrlite.username=${DIAGNOSTIC_EMRLITE_USERNAME}
diagnostic.emrlite.password=${DIAGNOSTIC_EMRLITE_PASSWORD}
diagnostic.emrlite.token-ttl-seconds=${DIAGNOSTIC_EMRLITE_TOKEN_TTL_SECONDS}
diagnostic.emrlite.refresh-ttl-seconds=${DIAGNOSTIC_EMRLITE_REFRESH_TTL_SECONDS}

diagnostic.poll.xray.tick-ms=${DIAGNOSTIC_POLL_XRAY_TICK_MS}
diagnostic.poll.give-up-minutes=${DIAGNOSTIC_POLL_GIVE_UP_MINUTES}
diagnostic.poll.interval-seconds=${DIAGNOSTIC_POLL_INTERVAL_SECONDS}
diagnostic.poll.truenat.initial-delay-minutes=${DIAGNOSTIC_POLL_TRUENAT_INITIAL_DELAY_MINUTES}
diagnostic.poll.truenat.tick-ms=${DIAGNOSTIC_POLL_TRUENAT_TICK_MS}

diagnostic.documents.storage-root=${DIAGNOSTIC_DOCUMENTS_STORAGE_ROOT}


28 changes: 21 additions & 7 deletions src/main/environment/common_example.properties
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ server.port=8081
# FHIR Config
fhir-url=http://localhost:8093/

# TM Config
tm-url=http://localhost:8089/
##--------------------------------------------## Primary db-------------------------------------------------------------------

Expand All @@ -24,10 +23,8 @@ springdoc.swagger-ui.enabled=true
logging.path=logs/
logging.file.name=logs/flw-api.log


jwt.secret=eefa40497bb9b2a8491b85069aff62e7596521c6816e471c464181b52eac7670ff91394a


# Redis Config
spring.redis.host=localhost

Expand All @@ -44,7 +41,24 @@ send-message-url=

crash.logs.base.path=<path used>





# ── Diagnostic Device Integration ────────────────────────────────────────────
# diagnostic.active-provider must be one of com.iemr.flw.masterEnum.DiagnosticProviderCode (currently: EMRLITE)
diagnostic.active-provider=${DIAGNOSTIC_ACTIVE_PROVIDER}

diagnostic.emrlite.base-url=${DIAGNOSTIC_EMRLITE_BASE_URL}
diagnostic.emrlite.login-url=${diagnostic.emrlite.base-url}/api/v1/integrations/login/
diagnostic.emrlite.refresh-url=${diagnostic.emrlite.base-url}/api/v1/integrations/getAccessToken/
diagnostic.emrlite.order-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/
diagnostic.emrlite.result-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/result/
diagnostic.emrlite.username=${DIAGNOSTIC_EMRLITE_USERNAME}
diagnostic.emrlite.password=${DIAGNOSTIC_EMRLITE_PASSWORD}
diagnostic.emrlite.token-ttl-seconds=${DIAGNOSTIC_EMRLITE_TOKEN_TTL_SECONDS}
diagnostic.emrlite.refresh-ttl-seconds=${DIAGNOSTIC_EMRLITE_REFRESH_TTL_SECONDS}

diagnostic.poll.xray.tick-ms=${DIAGNOSTIC_POLL_XRAY_TICK_MS}
diagnostic.poll.give-up-minutes=${DIAGNOSTIC_POLL_GIVE_UP_MINUTES}
diagnostic.poll.interval-seconds=${DIAGNOSTIC_POLL_INTERVAL_SECONDS}
diagnostic.poll.truenat.initial-delay-minutes=${DIAGNOSTIC_POLL_TRUENAT_INITIAL_DELAY_MINUTES}
diagnostic.poll.truenat.tick-ms=${DIAGNOSTIC_POLL_TRUENAT_TICK_MS}

diagnostic.documents.storage-root=${DIAGNOSTIC_DOCUMENTS_STORAGE_ROOT}
26 changes: 25 additions & 1 deletion src/main/environment/common_local.properties
Original file line number Diff line number Diff line change
Expand Up @@ -71,4 +71,28 @@ sms-password=
send-message-url=

crash.logs.base.path=logs/
stoptb.enforce.vanid = false
stoptb.enforce.vanid = false

# ── Diagnostic Device Integration ────────────────────────────────────────────
# diagnostic.active-provider must be one of com.iemr.flw.masterEnum.DiagnosticProviderCode (currently: EMRLITE)
diagnostic.active-provider=${DIAGNOSTIC_ACTIVE_PROVIDER}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please coordinate with @sac2kadam and ensure these new variables are added in DevOps repos.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, i will connect with him


diagnostic.emrlite.base-url=${DIAGNOSTIC_EMRLITE_BASE_URL}
diagnostic.emrlite.login-url=${diagnostic.emrlite.base-url}/api/v1/integrations/login/
diagnostic.emrlite.refresh-url=${diagnostic.emrlite.base-url}/api/v1/integrations/getAccessToken/
diagnostic.emrlite.order-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/
diagnostic.emrlite.result-url=${diagnostic.emrlite.base-url}/api/v1/integrations/orders/result/
diagnostic.emrlite.username=${DIAGNOSTIC_EMRLITE_USERNAME}
diagnostic.emrlite.password=${DIAGNOSTIC_EMRLITE_PASSWORD}
diagnostic.emrlite.token-ttl-seconds=${DIAGNOSTIC_EMRLITE_TOKEN_TTL_SECONDS}
diagnostic.emrlite.refresh-ttl-seconds=${DIAGNOSTIC_EMRLITE_REFRESH_TTL_SECONDS}

diagnostic.poll.xray.tick-ms=${DIAGNOSTIC_POLL_XRAY_TICK_MS}
diagnostic.poll.give-up-minutes=${DIAGNOSTIC_POLL_GIVE_UP_MINUTES}
diagnostic.poll.interval-seconds=${DIAGNOSTIC_POLL_INTERVAL_SECONDS}
diagnostic.poll.truenat.initial-delay-minutes=${DIAGNOSTIC_POLL_TRUENAT_INITIAL_DELAY_MINUTES}
diagnostic.poll.truenat.tick-ms=${DIAGNOSTIC_POLL_TRUENAT_TICK_MS}

diagnostic.documents.storage-root=${DIAGNOSTIC_DOCUMENTS_STORAGE_ROOT}


Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
package com.iemr.flw.controller;

import com.iemr.flw.dto.DiagnosticDocumentContent;
import com.iemr.flw.masterEnum.DiagnosticDocumentType;
import com.iemr.flw.service.DiagnosticDocumentService;
import io.swagger.v3.oas.annotations.Operation;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.MediaType;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
* SECURITY: this endpoint carries decrypted document bytes and MUST sit behind proper
* authentication/authorization in the real deployment. Today that's this app's existing
* JwtUserIdValidationFilter (utils/JwtUserIdValidationFilter.java), which protects every
* non-whitelisted path by default - do NOT add "/documents" to security.public-paths.
*/
@RestController
@RequestMapping("/documents")
public class DiagnosticDocumentController {

private final Logger logger = LoggerFactory.getLogger(DiagnosticDocumentController.class);

private final DiagnosticDocumentService diagnosticDocumentService;

public DiagnosticDocumentController(DiagnosticDocumentService diagnosticDocumentService) {
this.diagnosticDocumentService = diagnosticDocumentService;
}

@GetMapping
@Operation(summary = "Fetch the most recent stored document for a beneficiary + document type "
+ "(XRAY_CHEST, XRAY_CHEST_ANNOTATED, CAD, MTB_REPORT, MTB_PLUS_REPORT, or MDR_RIF_REPORT)")
public ResponseEntity<byte[]> getDocument(@RequestParam Long benId, @RequestParam DiagnosticDocumentType documentType) {
try {
DiagnosticDocumentContent content = diagnosticDocumentService.fetch(benId, documentType);
MediaType mediaType;
try {
mediaType = MediaType.parseMediaType(content.getContentType());
} catch (Exception e) {
mediaType = MediaType.APPLICATION_PDF;
}
return ResponseEntity.ok().contentType(mediaType).body(content.getContent());
} catch (Exception e) {
logger.error("Error fetching document: benId={}, documentType={}: {}", benId, documentType, e.getMessage());
return ResponseEntity.notFound().build();
}
}
}
129 changes: 129 additions & 0 deletions src/main/java/com/iemr/flw/controller/DiagnosticOrderController.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,129 @@
package com.iemr.flw.controller;

import com.google.gson.Gson;
import com.google.gson.GsonBuilder;
import com.iemr.flw.domain.iemr.DiagnosticOrder;
import com.iemr.flw.dto.DiagnosticOrderRequestDto;
import com.iemr.flw.dto.DiagnosticOrderResultDto;
import com.iemr.flw.dto.DiagnosticOrderStatusSummaryDto;
import com.iemr.flw.masterEnum.DiagnosticOrderType;
import com.iemr.flw.service.DiagnosticOrderService;
import com.iemr.flw.utils.ApiResponse;
import com.iemr.flw.utils.response.OutputResponse;
import io.swagger.v3.oas.annotations.Operation;
import jakarta.validation.Valid;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@RequestMapping("/diagnostic")
public class DiagnosticOrderController {

private final Logger logger = LoggerFactory.getLogger(DiagnosticOrderController.class);

private final DiagnosticOrderService diagnosticOrderService;

public DiagnosticOrderController(DiagnosticOrderService diagnosticOrderService) {
this.diagnosticOrderService = diagnosticOrderService;
}

@PostMapping("/order/push")
@Operation(summary = "Push a diagnostic order to the configured provider")
public String pushOrder(@RequestBody @Valid DiagnosticOrderRequestDto request) {
OutputResponse response = new OutputResponse();
try {
DiagnosticOrder order = diagnosticOrderService.createAndPushOrder(request);
response.setResponse(new Gson().toJson(order));
} catch (Exception e) {
logger.error("Error in pushOrder: {}", e.getMessage());
response.setError(5000, "Error pushing diagnostic order: " + e.getMessage());
}
return response.toString();
}

@PostMapping("/order/get")
@Operation(summary = "Get the diagnostic order for a beneficiary+orderType (latest, if more than one exists)")
public String getOrder(@RequestParam Long benRegID, @RequestParam String orderType) {
OutputResponse response = new OutputResponse();
try {
DiagnosticOrder order = diagnosticOrderService.getOrder(benRegID, orderType);
response.setResponse(new Gson().toJson(order));
} catch (Exception e) {
logger.error("Error in getOrder: {}", e.getMessage());
response.setError(5000, "Error fetching diagnostic order: " + e.getMessage());
}
return response.toString();
}

@PostMapping("/order/getByBen/{benRegID}")
@Operation(summary = "Get all diagnostic orders for a beneficiary")
public String getOrdersByBen(@PathVariable Long benRegID) {
OutputResponse response = new OutputResponse();
try {
List<DiagnosticOrder> orders = diagnosticOrderService.getOrdersByBenRegId(benRegID);
response.setResponse(new Gson().toJson(orders));
} catch (Exception e) {
logger.error("Error in getOrdersByBen: {}", e.getMessage());
response.setError(5000, "Error fetching diagnostic orders: " + e.getMessage());
}
return response.toString();
}

@PostMapping("/order/testCompleted")
@Operation(summary = "Mark that the physical test has completed for this beneficiary+orderType, starting the poll cadence")
public String markTestCompleted(@RequestParam Long benRegID, @RequestParam String orderType) {
OutputResponse response = new OutputResponse();
try {
DiagnosticOrder order = diagnosticOrderService.markTestCompleted(benRegID, orderType);
response.setResponse(new Gson().toJson(order));
} catch (Exception e) {
logger.error("Error in markTestCompleted: {}", e.getMessage());
response.setError(5000, "Error marking test completed: " + e.getMessage());
}
return response.toString();
}

@PostMapping("/order/result")
@Operation(summary = "Get the diagnostic result for benId+orderType, at whatever stage it's currently in")
public String getOrderResult(@RequestParam Long benId, @RequestParam String orderType) {
OutputResponse response = new OutputResponse();
try {
DiagnosticOrderResultDto result = diagnosticOrderService.getOrderResult(benId, orderType);
response.setResponse(new GsonBuilder().serializeNulls().create().toJson(result));
} catch (Exception e) {
logger.error("Error in getOrderResult: {}", e.getMessage());
response.setError(5000, "Error fetching diagnostic result: " + e.getMessage());
}
return response.toString();
}

@PostMapping("/order/poll")
@Operation(summary = "Trigger an immediate poll for one beneficiary+orderType's diagnostic order and return the result (ops use)")
public String pollOrder(@RequestParam Long benRegID, @RequestParam String orderType) {
OutputResponse response = new OutputResponse();
try {
DiagnosticOrderResultDto result = diagnosticOrderService.triggerManualPoll(benRegID, orderType);
response.setResponse(new GsonBuilder().serializeNulls().create().toJson(result));
} catch (Exception e) {
logger.error("Error in pollOrder: {}", e.getMessage());
response.setError(5000, "Error triggering poll: " + e.getMessage());
}
return response.toString();
}

@GetMapping("/order/getBeneficiariesByStatus")
@Operation(summary = "Get beneficiary IDs bucketed by diagnostic order status for the given order type, "
+ "optionally filtered by village and/or provider service map")
public ResponseEntity<ApiResponse> getBeneficiariesByStatus(
@RequestParam DiagnosticOrderType orderType,
@RequestParam(required = false) Integer villageId,
@RequestParam(required = false) Integer providerServiceMapId) {
DiagnosticOrderStatusSummaryDto result =
diagnosticOrderService.getOrderStatusSummary(orderType.name(), villageId, providerServiceMapId);
return ResponseEntity.ok(new ApiResponse(true, "Diagnostic order status summary fetched successfully", result));
}
}
74 changes: 74 additions & 0 deletions src/main/java/com/iemr/flw/domain/iemr/DiagnosticDocument.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
package com.iemr.flw.domain.iemr;

import jakarta.persistence.*;
import lombok.Data;
import org.hibernate.annotations.CreationTimestamp;
import org.hibernate.annotations.UpdateTimestamp;

import java.sql.Timestamp;

@Entity
@Table(name = "tb_diagnostic_document", schema = "db_iemr",
uniqueConstraints = @UniqueConstraint(columnNames = {"ben_reg_id", "document_type"}),
indexes = {
@Index(name = "idx_diagnostic_document_ben_reg_id", columnList = "ben_reg_id"),
@Index(name = "idx_diagnostic_document_order_type", columnList = "order_type"),
@Index(name = "idx_diagnostic_document_epoch_time", columnList = "epoch_time")
})
@Data
public class DiagnosticDocument {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
private Long id;

@Column(name = "diagnostic_order_id")
private Long diagnosticOrderId;

@Column(name = "ben_reg_id")
private Long benRegID;

@Column(name = "order_type", length = 20)
private String orderType;

@Column(name = "asset_type", length = 50)
private String assetType;

@Column(name = "document_type", length = 30)
private String documentType;

@Column(name = "epoch_time")
private Long epochTime;

@Column(name = "stored_file_name", length = 150)
private String storedFileName;

@Column(name = "stored_path", length = 255)
private String storedPath;

@Column(name = "sha256_hash", length = 64)
private String sha256Hash;

@Column(name = "content_type", length = 100)
private String contentType;

@Column(name = "original_file_name", length = 255)
private String originalFileName;

@Column(name = "created_by")
private String createdBy;

@CreationTimestamp
@Column(name = "created_date", updatable = false)
private Timestamp createdDate;

@Column(name = "modified_by")
private String modifiedBy;

@UpdateTimestamp
@Column(name = "last_mod_date")
private Timestamp lastModDate;

@Column(name = "deleted")
private Boolean deleted = false;
}
Loading