package thyyxxk.webserver.factory.examreport.model;

import lombok.Data;
import thyyxxk.webserver.entity.examinations.inspections.request.PatType;

@Data
public class ExamIndexRequest {
    /**
     * 卡类型，枚举值。
     * 值域：
     * SocialSecurityCard = 国家社保卡
     * HealthCard = 居民健康卡
     * MedicalCard = 院内诊疗卡
     * IDCard = 居民身份证
     * Undefine = 未知（默认值）
     * */
    private String cardType;
    private String cardNo;
    /**
     * 患者病历号类别（对应检验网的验单录入界面的病历号类型），枚举值。
     * 值域：
     * OutPatient = 门诊号
     * InPatient = 住院号
     * Lis = 验单号
     * Pis = 体检号
     * Marry = 婚检号
     * None = 未知（默认值）
     * */
    private PatType patientNumType;
    /**
     * 对应 patientNumType 参数的具体号码
     * */
    private String patientNum;
    /**
     * 查询起始日期： yyyy-MM-dd
     * */
    private String startDate;
    /**
     * 查询截止日期： yyyy-MM-dd
     * */
    private String endDate;

    private ExamIndexRequest() {}

    private ExamIndexRequest(String cardType, String cardNo, PatType patientNumType, String patientNum, String startDate, String endDate) {
        this.cardType = cardType;
        this.cardNo = cardNo;
        this.patientNumType = patientNumType;
        this.patientNum = patientNum;
        this.startDate = startDate;
        this.endDate = endDate;
    }

    public static class Builder {
        private String cardType = "Undefine";
        private String cardNo = "";
        private PatType patientNumType;
        private String patientNum;
        private String startDate;
        private String endDate;

        public Builder cardType(String cardType) {
            this.cardType = cardType;
            return this;
        }

        public Builder cardNo(String cardNo) {
            this.cardNo = cardNo;
            return this;
        }

        public Builder patientNumType(PatType patientNumType) {
            this.patientNumType = patientNumType;
            return this;
        }

        public Builder patientNum(String patientNum) {
            this.patientNum = patientNum;
            return this;
        }

        public Builder startDate(String startDate) {
            this.startDate = startDate;
            return this;
        }

        public Builder endDate(String endDate) {
            this.endDate = endDate;
            return this;
        }

        public ExamIndexRequest build() {
            return new ExamIndexRequest(cardType, cardNo, patientNumType, patientNum, startDate, endDate);
        }
    }
}
