package com.yidianling.im.session.extension;

import com.alibaba.fastjson.JSONObject;

/**
 * 处方单创建消息类型
 */
public class CustomAttachmentRecipel extends CustomAttachment {
    private static final String KEY_FROM_RECIPELID = "recipelId";
    private static final String KEY_FROM_SICKNESS = "sickness";
    private static final String KEY_FROM_DIAGNOSETIME = "diagnoseTime";


    private String fromRecipelId = "";
    private String fromSickness = "";
    private String fromDiagnoseTime = "";

    public CustomAttachmentRecipel() {
        super(CustomAttachmentType.TYPE_RECIPE);
    }

    @Override
    protected void parseData(JSONObject data) {
        fromRecipelId = data.getString(KEY_FROM_RECIPELID);
        fromSickness = data.getString(KEY_FROM_SICKNESS);
        fromDiagnoseTime = data.getString(KEY_FROM_DIAGNOSETIME);
    }

    @Override
    protected JSONObject packData() {
        JSONObject data = new JSONObject();
        data.put(KEY_FROM_RECIPELID, fromRecipelId);
        data.put(KEY_FROM_SICKNESS, fromSickness);
        data.put(KEY_FROM_DIAGNOSETIME, fromDiagnoseTime);
        return data;
    }

    public String getFromRecipelId() {
        return fromRecipelId;
    }

    public String getFromSickness() {
        return fromSickness;
    }
    public String getFromDiagnoseTime() {
        return fromDiagnoseTime;
    }

}
