package com.yihu.hos.rest.common.format;

import com.yihu.hos.rest.models.standard.adapter.AdapterSchemeVersionModel;
import com.yihu.hos.rest.models.standard.bo.AdapterVersion;
import com.yihu.hos.rest.services.standard.adapter.AdapterDictService;
import com.yihu.hos.rest.services.standard.adapter.AdapterMetadataService;
import com.yihu.hos.rest.services.standard.adapter.AdapterSchemeVersionService;

/**
 * 适配器基类,DAO缓存
 *
 * @created Created by Air on 2015/6/10.
 */
public class AdapterBase {
    private static AdapterSchemeVersionService adapterSchemeVersionService;
    private static AdapterMetadataService adapterMetadataService;
    private static AdapterDictService adapterDictService;


    protected AdapterVersion adapterVersion;


    public AdapterVersion getAdapterVersion() {
        AdapterSchemeVersionModel adapterSchemeVersionModel = getAdapterSchemeVersionService().getEhrAdapterVersionLasted();
        if (adapterSchemeVersionModel == null) {
            adapterSchemeVersionModel=new AdapterSchemeVersionModel();
        }
        String version = adapterSchemeVersionModel.getVersion();
         adapterVersion = new AdapterVersion(version);
        return adapterVersion;
    }

    public static AdapterSchemeVersionService getAdapterSchemeVersionService() {
        return adapterSchemeVersionService;
    }

    public static void setAdapterSchemeVersionService(AdapterSchemeVersionService adapterSchemeVersionService) {
        AdapterBase.adapterSchemeVersionService = adapterSchemeVersionService;
    }

    public static AdapterMetadataService getAdapterMetadataService() {
        return adapterMetadataService;
    }

    public static void setAdapterMetadataService(AdapterMetadataService adapterMetadataService) {
        AdapterBase.adapterMetadataService = adapterMetadataService;
    }

    public static AdapterDictService getAdapterDictService() {
        return adapterDictService;
    }

    public static void setAdapterDictService(AdapterDictService adapterDictService) {
        AdapterBase.adapterDictService = adapterDictService;
    }
}
