Documentation ¶
Index ¶
Constants ¶
const ( // ModuleName is the name of the module ModuleName = "admin" // StoreKey to be used when creating the KVStore StoreKey = ModuleName // Prefix of types Prefix_Doctor = "do-" Prefix_Patient = "pa-" Prefix_DrugStore = "ds-" Prefix_CaseHistory = "ch-" Prefix_RxPermission = "rp-" )
const ( Rx_ACTIVE = 1 //有效状态 Rx_LOCKING = 2 //药店锁定 Rx_USED = 3 //完成购买 )
const RouterKey = ModuleName // this was defined in your key.go file
RouterKey is the module name router key
Variables ¶
var ( // ErrWithdrawTooOften withdraw too often ErrInputInvalid = sdkerrors.Register(ModuleName, 1, "Your input is not valid") ErrPatientExisted = sdkerrors.Register(ModuleName, 2, "Patient already exists") ErrDoctorExisted = sdkerrors.Register(ModuleName, 3, "Doctor already exists") ErrDrugStoreExisted = sdkerrors.Register(ModuleName, 4, "Drugstore already exists") ErrDontHaveRx = sdkerrors.Register(ModuleName, 5, "Don't have any rx in this address") ErrDrugstoreNotExisted = sdkerrors.Register(ModuleName, 6, "Drugstore does not existed") ErrIllegalAccess = sdkerrors.Register(ModuleName, 7, "Illegal Rx Access") ErrDuplicatedUse = sdkerrors.Register(ModuleName, 8, "Rx can be used only once.") ErrRxDoesNotExists = sdkerrors.Register(ModuleName, 9, "Rx does not exists.") )
var ModuleCdc = codec.New()
ModuleCdc is the codec for the module
Functions ¶
func RegisterCodec ¶
RegisterCodec registers concrete types on the Amino codec
Types ¶
type AccountKeeper ¶
AccountKeeper is required for getting Account
type CaseHistory ¶
Rx is a struct that contains all the metadata of a Rx
func NewCaseHistory ¶
func NewCaseHistory(patient string) CaseHistory
func (CaseHistory) AddRx ¶
func (ch CaseHistory) AddRx(rx exported.Rx)
func (CaseHistory) UpdateStatus ¶
func (ch CaseHistory) UpdateStatus(id string, status sdk.Int)
type Doctor ¶
type Doctor struct { Pubkey string `json:"pubkey"` Name string `json:"name"` Gender string `json:"gender"` Hospital string `json:"hospital"` //就职医院 Department string `json:"department"` //所在科室 Title string `json:"title"` //职称 Introduction string `json:"introduction"` //介绍 }
Doctor is a struct that contains all the metadata of a doctor
type DrugStore ¶
type DrugStore struct { Pubkey string `json:"pubkey"` Name string `json:"name"` Phone string `json:"phone"` Group string `json:"group"` //所属连锁集团 BizTime string `json:"biz_time"` //营业时间 Location string `json:"location"` //门店地址 }
DrugStore is a struct that contains all the metadata of a DrugStore
type MsgRegisterDocter ¶
type MsgRegisterDocter struct { From sdk.AccAddress `json:"from"` PubKey string `json:"pubkey"` Name string `json:"name"` Gender string `json:"gender"` Hospital string `json:"hospital"` //就职医院 Department string `json:"department"` //所在科室 Title string `json:"title"` //职称 Introduction string `json:"introduction"` //介绍 }
MsgRegisterDocter defines a register doctor message
func NewMsgRegisterDocter ¶
func NewMsgRegisterDocter(from sdk.AccAddress, pubkey string, name string, gender string, hospital string, department string, title string, introduction string) MsgRegisterDocter
NewMsgRegisterDocter is a constructor function for MsgRegisterDocter
func (MsgRegisterDocter) GetSignBytes ¶
func (msg MsgRegisterDocter) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgRegisterDocter) GetSigners ¶
func (msg MsgRegisterDocter) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgRegisterDocter) Route ¶
func (msg MsgRegisterDocter) Route() string
Route should return the name of the module
func (MsgRegisterDocter) Type ¶
func (msg MsgRegisterDocter) Type() string
Type should return the action
func (MsgRegisterDocter) ValidateBasic ¶
func (msg MsgRegisterDocter) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type MsgRegisterDrugStore ¶
type MsgRegisterDrugStore struct { From sdk.AccAddress `json:"from"` Pubkey string `json:"pubkey"` Name string `json:"name"` Phone string `json:"phone"` Group string `json:"group"` //所属连锁集团 BizTime string `json:"biz_time"` //营业时间 Location string `json:"location"` //门店地址 }
MsgRegisterDrugStore defines a register drugstore message
func NewMsgRegisterDrugStore ¶
func NewMsgRegisterDrugStore(from sdk.AccAddress, pubkey string, name string, phone string, group string, biztime string, location string) MsgRegisterDrugStore
NewMsgRegisterDrugStore is a constructor function for MsgRegisterDrugStore
func (MsgRegisterDrugStore) GetSignBytes ¶
func (msg MsgRegisterDrugStore) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgRegisterDrugStore) GetSigners ¶
func (msg MsgRegisterDrugStore) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgRegisterDrugStore) Route ¶
func (msg MsgRegisterDrugStore) Route() string
Route should return the name of the module
func (MsgRegisterDrugStore) Type ¶
func (msg MsgRegisterDrugStore) Type() string
Type should return the action
func (MsgRegisterDrugStore) ValidateBasic ¶
func (msg MsgRegisterDrugStore) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type MsgRegisterPatient ¶
type MsgRegisterPatient struct { From sdk.AccAddress `json:"from"` Pubkey string `json:"address"` Name string `json:"name"` Gender string `json:"gender"` Birthday time.Time `json:"birthday"` Encrypted string `json:"encrypted"` //加密信息,如,疾病史,家族史,过敏药物等等 Envelope string `json:"envelope"` //密码信封 }
MsgRegisterPatient defines a register patient message
func NewMsgRegisterPatient ¶
func NewMsgRegisterPatient(from sdk.AccAddress, pubkey string, name string, gender string, birthday time.Time, encrypted string, envelope string) MsgRegisterPatient
NewMsgRegisterPatient is a constructor function for MsgRegisterPatient
func (MsgRegisterPatient) GetSignBytes ¶
func (msg MsgRegisterPatient) GetSignBytes() []byte
GetSignBytes encodes the message for signing
func (MsgRegisterPatient) GetSigners ¶
func (msg MsgRegisterPatient) GetSigners() []sdk.AccAddress
GetSigners defines whose signature is required
func (MsgRegisterPatient) Route ¶
func (msg MsgRegisterPatient) Route() string
Route should return the name of the module
func (MsgRegisterPatient) Type ¶
func (msg MsgRegisterPatient) Type() string
Type should return the action
func (MsgRegisterPatient) ValidateBasic ¶
func (msg MsgRegisterPatient) ValidateBasic() error
ValidateBasic runs stateless checks on the message
type Patient ¶
type Patient struct { Pubkey string `json:"pubkey"` Name string `json:"name"` Gender string `json:"gender"` Birthday time.Time `json:"birthday"` Encrypted string `json:"encrypted"` //加密信息,如,疾病史,家族史,过敏药物等等 Envelope string `json:"envelope"` //密码信封 }
Patient is a struct that contains all the metadata of a patient