package thyyxxk.webserver.entity.inpatient.conventions;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;
import thyyxxk.webserver.utils.DecimalUtil;

import java.util.Date;

@Data
public class ConventionDetail {
    private String name;
    private String orderName;
    private String doctorName;
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date occTime;
    private String xmCode;
    private String xmName;
    private String price;
    private String amount;
    private String fee;
    private String selfPay;
    private String actOrderNo;
    private String inpatientNo;
    private Integer admissTimes;

    public String getPrice() {
        return DecimalUtil.divide(fee, amount, 2);
    }

    public String getInpatientNo() {
        return null == inpatientNo ? "" : (inpatientNo).trim();
    }
}
