package com.yihu.hos.web.framework.constrant;

/**
 * @author Sand
 * @version 1.0
 * @created 2015.08.10 17:49
 */
public enum ErrorCode {

    MissMethod("ehr.common.miss.method"),
    MissTimestamp("ehr.common.miss.timestamp"),
    MissAppKey("ehr.common.miss.appid"),
    MissVersion("ehr.common.miss.version"),
    MissSign("ehr.common.miss.sign"),
    MissSignMethod("ehr.common.miss.signMethod"),

    InvalidMethod("ehr.common.invalid.method"),
    InvalidTimestamp("ehr.common.invalid.timestamp"),
    InvalidAppId("ehr.common.invalid.appid"),
    InvalidApiVersion("ehr.common.invalid.version"),
    InvalidSign("ehr.common.invalid.sign"),
    InvalidSignMethod("ehr.common.invalid.signMethod"),
    InvalidParameterFormat("ehr.common.invalid.parameterFormat"),
    MissRequiredArgument("ehr.common.miss.required.argument"),

    MissParameter("ehr.common.miss.parameter"),
    InvalidParameter("ehr.common.invalid.parameter"),
    AppTokenExpired("ehr.common.appToken.expired"),

    QueryNoData("ehr.common.query.null"),
    QueryTotalCount("ehr.common.query.count"),

    SuccessSave("ehr.common.success.update"),
    InvalidUpdate("ehr.common.invalid.update"),

    SuccessAdd("ehr.common.success.create"),

    SuccessDelete("ehr.common.success.delete"),
    InvalidDelete("ehr.common.invalid.delete"),

    InputRequestSingle("ehr.common.input.request.single"),
    InputRequestMultiple("ehr.common.input.request.multiple"),

    InvalidUser("ehr.invalid.user"),
    GetUserSecurityFailed("ehr.get.user.security.failed"),
    InvalidUserNameOrPwd("ehr.invalid.username.or.pwd"),
    InvalidValidateCode("ehr.login.validatecode.invalid"),
    ExpireValidateCode("ehr.login.validatecode.expire"),
    MailHasValidate("ehr.login.mail.hasinvaild"),
    InvalidMail("ehr.login.mail.invaild"),

    ExistUserForCreate("ehr.user.exist.create"),
    SuccessPublicKeyCreate("ehr.publicKey.success.create"),

    ExistOrgForCreate("ehr.org.exist.create"),
    ExistOrgForStandard("ehr.org.exist.standard"),
    InvalidAppRegister("ehr.app.register.invalid"),

    MissIdentityNo("ehr.patient.miss.identity.no"),
    InvalidIdentityNo("ehr.patient.invalid.identity.no"),
    PatientRegisterFailed("ehr.patient.register.failed"),
    InvalidFormatPatientRegister("ehr.patient.invalid.register.info"),
    PatientRegisterFailedForExist("ehr.patient.exist.create"),

    MissArchiveFile("ehr.archive.miss.file"),
    MissArchiveCrypto("ehr.archive.miss.cryptograph"),
    ParseArchiveCryptoFailed("ehr.archive.parse.cryptograph.failed"),
    SaveArchiveFailed("ehr.archive.save.failed"),

    RepeatSysDictName("ehr.sysDict.name.repeat"),
    RepeatOrgDict("ehr.orgDict.repeat"),
    RepeatOrgDictItem("ehr.orgDictItem.repeat"),
    RepeatOrgDataSet("ehr.orgDataSet.repeat"),
    RepeatOrgMetaData("ehr.orgMetaData.repeat"),
    InvalidCreateSysDict("ehr.sysDict.create.invalid"),
    NotExistSysDict("ehr.sysDict.exist.invalid"),
    InvalidDelSysDict("ehr.sysDict.del.invalid "),
    InvalidUpdateSysDict("ehr.sysDict.update.invalid"),
    RepeatSysDictEntryName("ehr.sysDictEntry.name.repeat"),
    InvalidCreateSysDictEntry("ehr.sysDictEntry.create.invalid"),
    InvalidSysDictEntry("ehr.sysDictEntry.name.invalid"),
    InvalidDelSysDictEntry("ehr.sysDictEntry.del.invalid"),
    InvalidUpdateSysDictEntry("ehr.sysDictEntry.update.invalid"),

    ParamError("ehr.std.param.error"),
    InvalidStdVersion("ehr.std.invalid.version"),
    GenerateArchiveFailed("ehr.std.generate.schema.file.failed"),
    GenerateArchiveFileStreamFailed("ehr.std.file.stream.generate.failed"),
    DownArchiveFileFailed("ehr.std.file.down.failed"),
    GenerateFileCryptographStreamFailed("ehr.std.file.cryptograph.generate.failed"),
    GenerateFileCryptographFailed("ehr.std.file.cryptograph.generate.failed"),
    GetStdVersionFailed("ehr.std.get.version.fail"),
    UnknownStdVersion("ehr.std.version.unknown"),

    GetCDAVersionListFailed("ehr.cda.version.list.get.failed"),
    GetCDAVersionFailed("ehr.cda.version.get.failed"),
    SaveCDAVersionFailed("ehr.cda.version.save.failed"),
    GetCDAInfoFailed("ehr.std.get.CDA.list.failed"),
    StdVersionHasPublished("ehr.cda.version.published"),

    GetSchemeVersionListFailed("ehr.scheme.version.list.get.failed"),
    GetSchemeVersionFailed("ehr.scheme.version.get.failed"),
    SaveSchemeVersionFailed("ehr.scheme.version.save.failed"),
    UpdateSchemeVersionFailed("ehr.scheme.version.update.failed"),
    DeleteSchemeVersionFailed("ehr.scheme.version.delete.failed"),
    ExistSchemeVersionName("ehr.scheme.version.name.exist"),

    GetSchemeListFailed("ehr.schemeList.Get.failed"),
    GetSchemeFailed("ehr.scheme.Get.failed"),
    SaveSchemeFailed("ehr.scheme.Save.failed"),
    UpdateSchemeFailed("ehr.scheme.update.failed"),
    DeleteSchemeFailed("ehr.scheme.delete.failed"),
    ExistSchemeVersion("ehr.scheme.version.exist"),
    ExistSchemeName("ehr.scheme.name.exist"),

    GetSchemeDispatchListFailed("ehr.schemeDispatchList.Get.failed"),
    GetSchemeDispatchFailed("ehr.schemeDispatch.Get.failed"),
    SaveSchemeDispatchFailed("ehr.schemeDispatch.Save.failed"),
    UpdateSchemeDispatchFailed("ehr.schemeDispatch.update.failed"),
    DeleteSchemeDispatchFailed("ehr.schemeDispatch.delete.failed"),

    StandardGetListFailed("ehr.standard.getlist.failed"),
    StandardSaveFailed("ehr.standard.save.failed"),
    StandardDeleteFailed("ehr.standard.delete.failed"),
    StandardDeletePublished("ehr.standard.delete.published"),
    StandardUpdateFailed("ehr.standard.update.failed"),
    StandardGetFailed("ehr.standard.get.failed"),
    StandardForkFailed("ehr.standard.fork.failed"),
    StandardImportFailed("ehr.standard.import.failed"),
    StandardExportFailed("ehr.standard.export.failed"),
    ExistStandardCode("ehr.standard.code.exist"),
    ExistStandardName("ehr.standard.name.exist"),
    ExistStandardVersion("ehr.standard.version.exist"),

    StandardVersionGetListFailed("ehr.standard.version.getlist.failed"),
    StandardVersionSaveFailed("ehr.standard.version.save.failed"),
    StandardVersionDeleteFailed("ehr.standard.version.delete.failed"),
    StandardVersionDeletePublished("ehr.standard.version.delete.published"),
    StandardVersionUpdateFailed("ehr.standard.version.update.failed"),
    StandardVersionGetFailed("ehr.standard.version.get.failed"),
    StandardVersionForkFailed("ehr.standard.version.fork.failed"),
    StandardVersionPublishFailed("ehr.standard.version.publish.failed"),
    ExistStandardVersionName("ehr.standard.version.name.exist"),
    StandardVersionUsedDeleteFailed("ehr.standard.version.used.delete.failed"),

    StandardCDACatalogGetListFailed("ehr.standard.cda.catalog.getlist.failed"),
    StandardCDACatalogSaveFailed("ehr.standard.cda.catalog.save.failed"),
    StandardCDACatalogDeleteFailed("ehr.standard.cda.catalog.delete.failed"),
    StandardCDACatalogUpdateFailed("ehr.standard.cda.catalog.update.failed"),
    StandardCDACatalogGetFailed("ehr.standard.cda.catalog.get.failed"),

    StandardCDADatasetMissVersion("ehr.standard.cda.dataset.miss.verison"),
    StandardCDADatasetMissID("ehr.standard.cda.dataset.miss.id"),
    StandardCDADatasetGetListFailed("ehr.standard.cda.dataset.getlist.failed"),
    StandardCDADatasetSaveFailed("ehr.standard.cda.dataset.save.failed"),
    StandardCDADatasetDeleteFailed("ehr.standard.cda.dataset.delete.failed"),
    StandardCDADatasetUpdateFailed("ehr.standard.cda.dataset.update.failed"),
    StandardCDADatasetGetFailed("ehr.standard.cda.dataset.get.failed"),

    StandardCDAMissVersion("ehr.standard.cda.miss.verison"),
    StandardCDAMissID("ehr.standard.cda.miss.id"),
    StandardCDAGetListFailed("ehr.standard.cda.getlist.failed"),
    StandardCDASaveFailed("ehr.standard.cda.save.failed"),
    StandardCDADeleteFailed("ehr.standard.cda.delete.failed"),
    StandardCDAUpdateFailed("ehr.standard.cda.update.failed"),
    StandardCDAGetFailed("ehr.standard.cda.get.failed"),

    StandardDatasetCatalogMissID("ehr.standard.dataset.catalog.miss.id"),
    StandardDatasetCatalogGetListFailed("ehr.standard.dataset.catalog.getlist.failed"),
    StandardDatasetCatalogSaveFailed("ehr.standard.dataset.catalog.save.failed"),
    StandardDatasetCatalogDeleteFailed("ehr.standard.dataset.catalog.delete.failed"),
    StandardDatasetCatalogUpdateFailed("ehr.standard.dataset.catalog.update.failed"),
    StandardDatasetCatalogGetFailed("ehr.standard.dataset.catalog.get.failed"),

    StandardDatasetMissVersion("ehr.standard.dataset.miss.version"),
    StandardDatasetMissID("ehr.standard.dataset.miss.id"),
    StandardDatasetGetListFailed("ehr.standard.dataset.getlist.failed"),
    StandardDatasetSaveFailed("ehr.standard.dataset.save.failed"),
    StandardDatasetDeleteFailed("ehr.standard.dataset.delete.failed"),
    StandardDatasetUpdateFailed("ehr.standard.dataset.update.failed"),
    StandardDatasetGetFailed("ehr.standard.dataset.get.failed"),
    ExistStandardDatasetCode("ehr.standard.dataset.code.exist"),

    StandardMetaDataMissVersion("ehr.standard.metadatamiss.version"),
    StandardMetaDataMissID("ehr.standard.metadatamiss.id"),
    StandardMetaDataGetListFailed("ehr.standard.metadatagetlist.failed"),
    StandardMetaDataSaveFailed("ehr.standard.metadatasave.failed"),
    StandardMetaDataDeleteFailed("ehr.standard.metadatadelete.failed"),
    StandardMetaDataUpdateFailed("ehr.standard.metadataupdate.failed"),
    StandardMetaDataGetFailed("ehr.standard.metadataget.failed"),
    ExistStandardMetaDataCode("ehr.standard.metaData.code.exist"),

    StandardDictMissVersion("ehr.standard.dict.miss.version"),
    StandardDictMissID("ehr.standard.dict.miss.id"),
    StandardDictGetListFailed("ehr.standard.dict.getlist.failed"),
    StandardDictSaveFailed("ehr.standard.dict.save.failed"),
    StandardDictDeleteFailed("ehr.standard.dict.delete.failed"),
    StandardDictUpdateFailed("ehr.standard.dict.update.failed"),
    StandardDictGetFailed("ehr.standard.dict.get.failed"),
    ExistStandardDictCode("ehr.standard.dict.code.exist"),

    StandardDictEntryMissVersion("ehr.standard.dict.entry.miss.version"),
    StandardDictEntryMissID("ehr.standard.dict.entry.miss.id"),
    StandardDictEntryGetListFailed("ehr.standard.dict.entry.getlist.failed"),
    StandardDictEntrySaveFailed("ehr.standard.dict.entry.save.failed"),
    StandardDictEntryDeleteFailed("ehr.standard.dict.entry.delete.failed"),
    StandardDictEntryUpdateFailed("ehr.standard.dict.entry.update.failed"),
    StandardDictEntryGetFailed("ehr.standard.dict.entry.get.failed"),
    ExistStandardDictEntryCode("ehr.standard.dict.entry.code.exist"),

    GetDataSetListFailed("ehr.datasetlist.Get.failed"),
    GetDataSetFailed("ehr.dataset.Get.failed"),
    SavedatasetFailed("ehr.dataset.Save.failed"),
    UpdateDatasetFailed("ehr.dataset.update.failed"),
    DeleteDataSetFailed("ehr.dataset.delete.failed"),
    GetDataSetRelationListFailed("ehr.datasetRelationlist.Get.failed"),
    GetDataSetRelationFailed("ehr.datasetRelation.Get.failed"),
    SaveDatasetRelationFailed("ehr.datasetRelation.Save.failed"),
    UpdateatasetRelationFailed("ehr.datasetRelation.update.failed"),
    DeleteDataSetRelationFailed("ehr.datasetRelation.delete.failed"),

    GetMetaDataListFaield("ehr.metadatalist.Get.failed"),
    GetMetaDataFailed("ehr.metadata.Get.failed"),
    SaveMetaDataFailed("ehr.metadata.save.failed"),
    UpdateMetaDataFailed("ehr.metadata.update.failed"),
    DeleteMetaDataFailed("ehr.metadata.delete.failed"),

    GetDictListFaild("ehr.dictlist.Get.failed"),
    GetDictFaild("ehr.dict.Get.failed"),
    GetDictEntryListFailed("ehr.dict.entries.get.failed"),
    GetDictEntryFailed("ehr.dict.entry.get.failed"),
    SaveDictFailed("ehr.dict.Save.failed"),
    UpdateDictFailed("ehr.dict.update.failed"),
    DeleteDictFailed("ehr.dict.delete.failed"),
    saveDictEntryFailed("ehr.dict.entry.save.failed"),
    UpdateDictEntryFailed("ehr.dict.entry.update.failed"),
    DeleteDictEntryFailed("ehr.dict.entry.delete.failed"),

    GetPublisherListFaield("ehr.publisherList.get.failed"),
    GetPublisherFailed("ehr.publisher.get.failed"),
    SavePublisherFailed("ehr.publisher.save.failed"),
    UpdatePublisherFailed("ehr.publisher.update.failed"),
    DeletePublisherFailed("ehr.publisher.delete.failed"),

    GetStandardSourceFailed("ehr.std.get.source.list.failed"),

    GenerateUserKeyFailed("ehr.security.generate.user.key.failed"),
    GetUserKeyFailed("ehr.security.get.user.key.failed"),
    UserAccessTokenExpired("ehr.security.token.expired"),
    UserRefreshTokenError("ehr.security.token.refreshError"),
    UserRevokeTokenFailed("ehr.security.token.revoke"),

    CodeIsNull("ehr.system.code.null"),
    NameIsNull("ehr.system.name.null"),
    VersionCodeIsNull("ehr.system.versioncode.null"),

    GetEhrArchiveFailed("ehr.ehr.get.archive"),
    GetEhrDataSetFailed("ehr.ehr.get.data.set"),

    CreateEhrDataSetTableFailed("ehr.ehr.create.data.set.table.failed"),
    TruncateTableFailed("ehr.hbase.truncate.table.failed"),
    GetTableFailed("ehr.hbase.get.table.failed"),

    ClearSolrDataFailed("ehr.clear.solr.data.failed"),

    //
    UnknownJsonPackageId("ehr.json.package.unknown"),

    // Quartz Scheduler
    SchedulerStartFailed("ehr.scheduler.start.failed"),
    SchedulerShutdownFailed("ehr.scheduler.shutdown.failed"),
    SchedulerAddJobFailed("ehr.scheduler.add.job"),
    SchedulerRemoveJobFailed("ehr.scheduler.remove.job"),

    GetJobDetailFailed("ehr.scheduler.get.job.failed"),
    GetTriggerFailed("ehr.scheduler.get.trigger.failed"),

    //Other
    SystemError("ehr.system.error");

    private final String errorCode;

    private ErrorCode(String errorCode) {
        this.errorCode = errorCode;
    }

    public String getErrorCode() {
        return errorCode;
    }
}
