Project

General

Profile

Actions

Task #49

open

Admin – Pre-Consultation Fields Management

Added by Varsha N about 1 month ago. Updated about 1 month ago.

Status:
Resolved
Priority:
High
Assignee:
Start date:
01/20/2026
Due date:
01/21/2026 (44 days late)
% Done:

0%

Estimated time:

Description

Task Description:
Implement the Pre-Consultation Fields management feature in the Admin module.
This allows the admin to configure what medical fields reception staff must fill before doctor consultation, using the PreConsultField entity.
The admin should be able to create, view, update, activate/deactivate, and order pre-consultation fields for a hospital.

Navigation:
Admin Login → Masters → Pre-Consultation Fields

Required Fields:
id (PK, auto-generated)
hospitalId (linked hospital)
fieldKey (unique system key)
label (display name)
inputType (ENUM)
-NUMBER
-TEXT
-DROPDOWN
-BOOLEAN
unit (optional)
isActive (default: true)
sortOrder
createdAt (auto-generated)

Features to Implement:
Create a new pre-consultation field
Assign field to a hospital
Select input type (NUMBER / TEXT / DROPDOWN / BOOLEAN)
Add optional unit for NUMBER input type
View list of all pre-consultation fields
Display field label, key, input type, unit, status, and sort order
Edit existing pre-consultation field
Prevent editing of field key after creation
Activate or deactivate a field
Hide inactive fields from reception screen
Set and update sort order for display sequence
Ensure reception screen follows sort order
Show minimal success / error messages
Disable save button during API call

Actions #1

Updated by Varsha N about 1 month ago

package com.docdesk.docdesk.entity;

import jakarta.persistence.*;
import java.time.LocalDateTime;

@Entity
@Table(name = "preconsult_fields")
public class PreConsultField {

@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "field_id")
private Long id;

@Column(name = "hospital_id", nullable = false)
private Long hospitalId;

@Column(name = "field_key", nullable = false, unique = true)
private String fieldKey;

@Column(nullable = false)
private String label;

@Enumerated(EnumType.STRING)
@Column(name = "input_type", nullable = false)
private InputType inputType;

private String unit;

@Column(name = "is_active")
private Boolean isActive = true;

@Column(name = "sort_order")
private Integer sortOrder;

@Column(name = "created_at", updatable = false)
private LocalDateTime createdAt;

public enum InputType {
    NUMBER, TEXT, DROPDOWN, BOOLEAN
}

@PrePersist
protected void onCreate() {
    createdAt = LocalDateTime.now();
}

/* ---------- GETTERS & SETTERS ---------- */

public Long getId() { return id; }
 public Long getHospitalId() { return hospitalId; }
public void setHospitalId(Long hospitalId) { this.hospitalId = hospitalId; }
public String getFieldKey() { return fieldKey; }
public void setFieldKey(String fieldKey) { this.fieldKey = fieldKey; }
public String getLabel() { return label; }
public void setLabel(String label) { this.label = label; }
public InputType getInputType() { return inputType; }
public void setInputType(InputType inputType) { this.inputType = inputType; }
public String getUnit() { return unit; }
public void setUnit(String unit) { this.unit = unit; }
public Boolean getIsActive() { return isActive; }
public void setIsActive(Boolean isActive) { this.isActive = isActive; }
public Integer getSortOrder() { return sortOrder; }
public void setSortOrder(Integer sortOrder) { this.sortOrder = sortOrder; }

}

Actions #2

Updated by Sai Krishna about 1 month ago

  • Status changed from New to In Progress
Actions #3

Updated by Sai Krishna about 1 month ago

  • Status changed from In Progress to Resolved
Actions

Also available in: Atom PDF