1.智能合约状态图
2.实现功能,通过背书,签收机制实现任务在各部门流转
3.相关sdk
- Chaincode接口 {Init,Invoke}方法
- ChaincodeStubInterface接口
1.GetTxTimestamp
2.CreateCompositeKey
3.GetQueryResult
4.GetHistoryForKey
5.SetEvent
6.GetStateByPartialCompositeKey
7.GetFunctionAndParameters
8.PutState
9.DelState
10.GetStateByRange
4.代码架构图
5.开发环境(centos7.4,goland)
6.global.go代码
1 package global 2 3 import "github.com/hyperledger/fabric/common/flogging" 4 5 const ( 6 PrescriptionBlockchain_State_NewPublish ="NewPublish" 7 PrescriptionBlockchain_State_EndrWaitSign ="EndrWaitSign" 8 PrescriptionBlockchain_state_EndrSigned ="EndrSigned" 9 HospitalNO_DayTime_PrescriptionID_IndexName ="hospitalno~daytime-prescriptionid" 10 PatientID_PrescriptionID_IndexName ="patientid~prescriptionid" 11 State_PrescriptionID_IndexName ="state~prescriptionid" 12 PendingReceivePrescriptionDeptID_PrescriptionID_IndexName="pendingreceiveprescriptiondeptid~prescriptionid" 13 ReceivingPrescriptionDeptID_PrescriptionID_IndexName="receivingprescriptiondeptid~prescriptionid" 14 OpenPrescriptionDeptID_PrescriptionID_IndexName="openprescriptiondeptid~prescriptionid" 15 ) 16 var( 17 Logger =flogging.MustGetLogger("PrescriptionChaincode") 18 )