package com.openhis.web.document.dto;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;

@Data
@Accessors(chain = true)
public class DocRecordDto {
    @TableId(type = IdType.ASSIGN_ID)
    @JsonSerialize(using = ToStringSerializer.class)
    private Long id;
    /**
     * 文书定义ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long definitionId;

    private String definitionBusNo;
    /**
     * 文档内容 存储为JSON格式
     */

    private String contentJson;
    /**
     * 记录状态 0草稿/暂存 1提交 2归档 3修改  DocStatusEnum 枚举类
     * 0草稿/暂存 1提交 2归档 3修改
     */
    private Integer statusEnum;
    /**
     * 记录科室ID
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long organizationId;
    /**
     * 就诊id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long encounterId;
    /**
     * patientId 病人id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long patientId;
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date recordTime;
    private String createBy;
    private String source;
    /**
     * 记录名称
     */
    private String name;
    private String version;
}
