# WeChat SDK Program for Aging
# I Access programmes
WeChat provides a front-end SDK, where the receiver only needs to provide a div selector to initialize, similar to the way the VUE is provided, and after entering the corresponding protocol field in different page steps, the SDK renders the age-appropriate page in the corresponding div.
The style and interaction of the page are all handled by the SDK, and the access party only needs to handle the logical part of the page (data interface pull, event hook callback logic, etc.).
# II Example of Access Code
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1,maximum-scale=1,user-scalable=no">
<meta name="apple-mobile-web-app-capable" content="no">
<meta name="format-detection" content="telephone=no">
<link rel="icon" href="//res.wx.qq.com/a/wx_fed/assets/res/NTI4MWU5.ico">
<link rel="dns-prefetch" href="//res.wx.qq.com">
<title></title>
<!-- 【必须】业务方代码,调用长辈就医SDK begin -->
<script>
// 开发者必须要完善下面的代码
window.onElderMedicalSDKReady = function() {
var elderMedicalSDK = window.elderMedicalSDK
// 初始化SDK的回调函数
elderMedicalSDK.init({
onIndexPageMount: function() {
// TODO: 从后台获取并设置院区的数据
var branchList = []
// 封装Promise给医院使用,可以组合一些异步的请求
// https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Global_Objects/Promise
function getBranchList() {
return new elderMedicalSDK.Promise(function(resolve, reject) {
setTimeout(function() {
resolve(branchList)
}, 500)
}
getBranchList().then(function(branchList) {
elderMedicalSDK.setBranchList({
branchList: branchList,
errcode: 0,
errmsg: ''
})
})
},
// 选择院区点击
onNoticePageMount: function(branch) {
// 从后台获取就医须知的通知,并通过下面的函数设置
elderMedicalSDK.setNotice({
notice: '',
errmsg: '',
errcode: 0
})
},
// 就医须知确认点击
onDepartmentPageMount: function() {
// TODO: 从后台获取就医科室,并通过下面的函数设置
var regDept = []
elderMedicalSDK.setDepartmentList({
departmentList: regDept,
errcode: 0,
errmsg: ''
})
},
// 选择科室点击
onDoctorPageMount: function(dept) {
// TODO: 从后台获取就医科室,并通过下面的函数设置
var dateList = []
elderMedicalSDK.setDoctorDateList({ dateList: dateList,
errmsg: '',
errcode: 0
})
},
// 选择医生点击
onPeriodPageMount: function(doctor) {
// TODO: 从后台获取到该医生的某天的挂号的时间点,并通过下面的函数设置
elderMedicalSDK.setDoctorTimePointInfo({
doctorInfo: {},
amList: [],
pmList: [],
errcode: 0,
errmsg: ''
})
},
onPayPageMount: function(payPageObj) {
// TODO: 获取挂号的详情信息,比如就诊人等
},
onPayOrder: function(payOrder) {
// TODO: 下单挂号并且跳转到支付的页面
},
onCertPayOrder: function(payOrder) {
// TODO: 点击医保支付选项
},
onCancelOrder: function(payOrder) {
// TODO: 点击退号按钮触发
},
// ...
})
// 判断下sdk是否是新版
if (elderMedicalSDK.setOptions) {
elderMedicalSDK.setOptions({
showCancelOrder: false, // 挂号详情页面,是否显示取消挂号,默认是true表示显示
notice: {
checkedBgColor: 'red', // 就医须知-勾选框颜色
btnBgColor: 'red' // 就医须知-按钮背景色
},
chooseDoctor: {
chooseDateBgColor: 'red', // 选择医生-当前日期背景色
recentTagColor: 'blue', // 选择医生-最近就诊字体颜色
chooseDateColor: 'red', // 选择医生-日期有号文字颜色
canRegColor: 'green', // 选择医生-剩余号数量颜色
chooseDateColor: 'blue', // 选择医生-已满颜色
},
choosePeriod: {
color: 'red', // 选择就诊时段-文字颜色
},
payDetail: {
btnBgColor: 'red' // 确认挂号-按钮背景色
}
})
}
}
</script>
<!-- 【必须】业务方代码,调用长辈就医SDK end -->
<!-- 【必须】引用长辈就医的SDK begin -->
<script defer="defer" src="https://wximg.qq.com/cityservices/insuranceres/eldermedical/js/0.2.4/elder-medical-sdk-0.2.4.js"></script>
<!-- 【必须】引用长辈就医的SDK end -->
</head>
<body>
<!-- 【必须】长辈就医的SDK 会注入到此DOM结构 begin -->
<div id="app"></div>
<!-- 【必须】长辈就医的SDK 会注入到此DOM结构 end -->
</body>
</html>
# Three Processes & SDK Protocol Introduction
# 1 Registration process
# 1.1 Select a hospital district
Page Preview
The data for this page is set by elderMedicalSDK.setBranchList (param) (called inside onMount). The parameter param is an Object object defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
branchList | List of all districts | Array\ [BranchItem] | Yes | BranchItem See table below |
errcode | return code | number | No | Success, 0 means success, failure to fill the default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
BranchItem Definition:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
name | Name of Campus | String | yes | |
address | Hospital Address | String | yes | |
ybCode | Campus code | String | yes | The unique identification of the hospital area. Subsequent departments need to obtain it based on this field |
phone | Hospital area telephone | String | no |
Select the hospital trigger onNoticePageMount ({ybCode}) callback function, will automatically enter the medical information page, BranchItem definition parameters as above.OnNoticePageMount to achieve inside, the need to get medical advice content, and through elderMedicalSDK.setNotice (param) interface to set the display on the page
# 1.2 What to know about medical treatment
Page Preview
Eldermedicalsdk.setnotice (param) The function param is defined as follows:
Parameter Name | Description | Type | Required | Notes |
---|---|---|---|---|
notice | Medical information content | String | Yes | |
errcode | return code | number | No | Whether or not to succeed, 0 means success, no default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
In the onDepartmentPageMount callback, you need to get the department information needed for the next step through the background, and then set the department information through elderMedicalSDK.setDepartmentList (deptList)
# 1.3 Select a department
Page Preview:
Eldermedicalsdk.setdepartmentlist (param) The input param is an Object whose definition:
Field Name | Description | Parameter Type | Required or Not | Note |
---|---|---|---|---|
departmentList | Department Information | Array\ [DepartmentItem] | DepartmentItem definition see below | |
showRecent | Does it support recently visited doctors | Boolean | No | Default true |
errcode | return code | number | No | Success, 0 means success, failure to fill the default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
DepartmentItem defines hooks:
Field Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
deptId | Unique Department ID | String | yes | |
deptName | Name of department | String | yes | |
deptList | List of Division II Sections | Array[DepartmentItem] | no | If the department structure is secondary, the input is via this field |
Selecting a department triggers a callback onDoctorPageMount (item) . Item is an Object object, containing two fields, deptId and deptName.The onDoctorPageMount function goes through the background to the doctor's list of registered dates, and then through elderMedicalSDK.setDoctorDateList (param) Set the data for the next step (go to 1.4 below)
If selects the most recent doctor , triggers a callback onRecentDoctorPageMount (), onRecentDoctorPaceMount** elderMedicalSDK.setRecentDoctorList (param)** Set the data for the next step (go to step 1.5 below)
# 1.4 Choose a Doctor
Page Preview
The input param for elderMedicalSDK.setDoctorDateList (param) is an Object type, defined as follows:
Field Name | Description | Type | Required | Note |
---|---|---|---|---|
dateList | List of registered doctors | Array\ [DateDoctorItem] | Is | DateDoctorItem is defined as follows |
errcode | return code | number | No | Success, 0 means success, failure to fill the default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
DateDoctorItem is defined as follows
Parameter Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
date | Dates that can be registered | String | yes | Format example "2022-10-10" |
doctorList | A licensed physician under that date | Array[DoctorItem] | yes | DoctorItem is defined as follows |
DoctorItem is defined as follows
Parameter Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
doctorId | Unique Doctor ID | String | yes | |
deptId | Doctor's Department ID | String | yes | |
deptName | Name of doctor's department | String | yes | |
hospSubname | Name of the hospital district | String | no | |
ybCode | The district code of the district in which it is located | String | no | |
doctorName | The doctor's name | String | yes | |
gender | Doctor's Sex | String | yes | F is female and M is male. |
titleId | Doctor Title ID | String | yes | |
titleName | Doctor's Title | String | yes | Example "Chief Physician" |
doctorDesc | Doctor's Description | String | yes | |
doctorPhoto | Doctor's Photo URL | String | yes | Is a link to a photo of the http protocol |
regProj | Registered project code | String | yes | |
regFee | Registration fees | String | yes | Example "30.00," unit yuan |
count | Number of remaining numbers | number | yes | Number of remaining registered numbers |
Select date triggers elderMedicalSDK.onDateClick (param) Event, param parameter is Object, contains date field, format is "2022-10-22," if you need to pull some other data, such as registration fee,You can re-pull and update data for a given day via updateDoctorDateList , passing the same parameters as setDoctorDateList, and updateDocDateList merges with setDoctorDatelist.
Selecting a doctor triggers elderMedicalSDK.onPeriodPageMount (periodPage) . The parameter periodPage is defined as follows:
Parameter Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
doctorId | Unique Doctor ID | String | yes | |
ybCode | Unique District ID | String | yes | |
deptId | Doctor's Department ID | String | yes | |
regDate | Date of registered appointment selected | String | yes | Example "2022-10-22" |
regProj | Registered project code | String | yes | |
titleId | Doctor Title ID | String | yes |
In onPeriodPageMount this function requires background access to the doctor's appointment time on the corresponding date, and through the interface elderMedicalSDK.setDoctorTimePointInfo(timePointInfo) to show the following
# 1.5 Choose the doctor you visited recently
Page Preview
Selecting the most recent doctor is by selecting the doctor first and then the date, so the event triggered and the process of selecting the physician will be different, this page via elderMedicalSDK.setRecentDoctorList (param) Set physician data, param defined as follows
Field Name | Description | Type | Required | Note |
---|---|---|---|---|
doctorList | List of registered doctors | Array\ [DoctorItem] | Yes | DoctorItem defined in the Selecting a Doctor section |
errcode | return code | number | No | Success, 0 means success, failure to fill the default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
Clicking on the doctor brings up a half-screen popup of the selected date and triggers the event onRecentDoctorClick (param) , paramIs a DoctorItem object that gets the date of the doctor's visit at that event and then passes the elderMedicalSDK.setRecentDoctorDateList (param) Set the scheduling date, param is an Object, defined as follows:
Field Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
dateList | Date list | Array[DateItem] | yes | You only need to pass the date and count fields |
errcode | Return code | number | no | Whether or not it is successful, 0 indicates success, and not filling in the default indicates success |
errmsg | Error message | String | no | When the errcode is not 0, this field represents the error message and the front end displays this error message |
Half-screen pop-up after selecting the date, and enter the selected time page, and will trigger onPeriodPageMount (param) Function, param is an Object, which is defined as follows:
Field Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
doctorId | Unique Doctor ID | String | yes | |
ybCode | Unique District ID | String | yes | |
deptId | Doctor's Department ID | String | yes | |
regDate | Date of registered appointment selected | String | yes | |
regProj | Registered project code | String | yes | |
titleId | Doctor Title ID | String | yes |
# 1.6 Choose the time
The page is previewed as follows, via the interface elderMedicalSDK.setDoctorTimePointInfo(timePointInfo) to set the content displayed below
The input param for elderMedicalSDK.setDoctorTimePointInfo (param) is an Object type defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
doctorInfo | Doctor's Details | DoctorItem | Yes | DoctorItem definition see above |
list | List of registrable periods for each time period | Array\ [TimePointInfo] | Is | TimePointInfo is defined as follows |
errcode | return code | number | No | Whether or not to succeed, 0 means success, no default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
TimePointInfo is defined as follows:
Parameter Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
pointId | Unique ID for that period | String | no | |
beginTime | The start time of the period | String | yes | Example "08: 00" |
endTime | The end time of the period | String | yes | Example "08: 30" |
timeType | Type of time period | String | yes | The callback at the registration will take back, such as am, pm and the like, defined by the hospital |
timeTypeWording | Presentation papers for that period | String | yes | The copy that appears on the page, such as in the morning, afternoon, or throughout the day, is defined by the hospital |
leaveCount | Number of remaining numbers for the period | number | yes |
You will automatically jump to the following page, triggering the event onPayPageMount (param) . Param is an Object, defined as follows
Field Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
pointId | Unique ID for that period | String | no | Bring it when you click on a certain registration period |
doctorId | Unique Doctor ID | String | yes | |
ybCode | Unique District ID | String | yes | |
deptId | Doctor's Department ID | String | yes | |
regDate | Date of registered appointment selected | String | yes | |
regProj | Registered project code | String | yes | |
titleId | Doctor Title ID | String | yes | |
timePointBegin | The beginning period of the visit | String | yes | Example "08: 30" |
timePointEnd | The end of the visit | String | yes | Example "09: 00" |
timeType | Type of visit period | String | yes | The onPayOrder callback at the registration will bring back, for example am, pm, and the like, defined by the hospital |
In onPayPageMount you need to set the following information on the registration information confirmation page via the interface setOrderPayInfo
# 1.7 Confirm registration information
Example pages
The page's information needs to be passed through the elderMedicalSDK.setOrderPayInfo (param) The parameter param of the interface is an Object object defined as follows
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
orderInfo | Order Details | OrderPayInfo | Yes | OrderPayInfo is defined as follows |
errcode | return code | number | No | Success, 0 means success, failure to fill the default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
OrderPayInfo type definition:
Field Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
deptId | Department ID | String | no | Use for reporting |
deptName | Name of department | String | yes | |
doctorId | Doctor ID | String | no | Use for reporting |
doctorName | Name of the doctor | String | yes | |
fee | Amount paid | String | yes | For example, "0.1" |
ybCode | District ID | String | no | Use for reporting |
hospSubname | Name of surgical branch | String | yes | |
orderId | Order ID | String | no | |
orderStatus | Order Status | Number | yes | The values are as follows: 10 - Register pending payment, 11 - Register failing with refund, 12 - Register exception, 13 - Register processing, 20 / 30 - Register success |
orderNoPay | Does it support signing up without payment? | Boolean | no | Click to confirm when true will not pull up the payment selection pop-up, will directly trigger onPayOrder event, then set the orderStatus to 20 / 30 to register successfully |
rollbackStatus | Cancel order status | Number | no | Default 0 takes the values as follows 0 - Not cancelled 10 - Cancelled order, refund in mid 20 - Canceled order, refund successful 30 - Cancelled order, return failed |
rollbackErrMsg | Reasons for the failure of refunds | String | no | Rollbackstatus is 30, this field returns the reason why the refund failed |
rollbackTime | When to cancel an order | String | no | Refund time, required under cancellation status, unix timestamp |
rollbackFee | Refund Amount | String | no | The refund amount, which must be filled out under cancellation order status, such as "0.1" |
payType | Type of payment | Number | yes | 1 represents out-of-pocket costs and 2 represents health insurance |
patName | Name of the patient | String | yes | |
regDate | Date of visit | String | yes | Examples: "2022-10-19" |
cardNumber | Medical attendance card number | String | yes | Set it again after the payment was successful. |
timePointBegin | Opening time of the consultation period | String | yes | Example "08: 30" |
timePointEnd | End time of the consultation period | String | yes | Example "09: 30" |
visitingSeq | Number of visits | String | yes | |
visitingRoomLoc | Location of the clinic | String | yes | |
outpatientNum | Outpatient flow numbers | String | yes | |
supportCertPay | Does it support health care payments? | Boolean | no | Default is true |
identityTypeList | Type of identity | Array | no | IdentityType is an object containing text and value |
Click "pay" - "pay at own expense" trigger elderMedicalSDK.onPayOrder (orderReq) , orderReqIs defined as follows (same as the parameters for the onPayPageMount event above):
Field Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
doctorId | Unique Doctor ID | String | yes | |
ybCode | Unique District ID | String | yes | |
deptId | Doctor's Department ID | String | yes | |
regDate | Date of registered appointment selected | String | yes | |
regProj | Registered project code | String | yes | |
titleId | Doctor Title ID | String | yes | |
timePointBegin | The beginning period of the visit | String | yes | Example "08: 30" |
timePointEnd | The end of the visit | String | yes | Example "09: 00" |
timeType | Type of visit period | String | yes | The onPayOrder callback at the registration will bring back, for example am, pm, and the like, defined by the hospital |
identityType | Type of identity selected | IdentityType | no | IdentityType is an object containing text and value |
The developer starts the WeChat payment at this callback. After the user pays, the developer sets the result of the payment by setOrderPayInfo .If an error is reported, it calls elderMedicalSDK.setOrderErrorInfo (res) to set the error message. Res contains three fields: type, errcode, and errmsg.
The parameter res of elderMedicalSDK.setOrderErrorInfo (res) is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
type | Type of error | String | yes | The value is "pay," "certpay," "cancel," respectively, representing the registration, medical insurance payment, cancel the registration of three scenarios |
errcode | Return code | number | no | Whether or not it is successful, 0 indicates success, and not filling in the default indicates success |
errmsg | Error message | String | no | When the errcode is not 0, this field represents the error message and the front end displays this error message |
The parameter param of the elderMedicalSDK.setOrderPayInfo (param) interface is an Object object, defined in the description above.
Click "Pay" - "Medicare Pay" to trigger elderMedicalSDK.onCertPayOrder (payOrder) ,This callback generates the order of medical insurance payment, and jumps to the H5 page of medical insurance payment to pay.If an error is reported, the error message is set by calling elderMedicalSDK.setOrderErrorInfo (res) . Res contains the fields errcode and errmsg.
# 1.8 Notify you of your password
Examples of Interaction
Click the Cancel sign at the bottom to trigger the event onCancelOrder (payOrder) ,If successful, the developer sets the result of the payment via setOrderPayInfo .If an error is reported, it calls elderMedicalSDK.setOrderErrorInfo (res) to set the error message. Res contains three fields: type, errcode, and errmsg.Note that this number is a paid number and must be refunded to the user, and the rollbackStatus should be set to 30 after the refund.
# 1.9 Registered records
Examples of Interaction
The link to the page is https://hostname/path?query#/record-list
The entry page triggers the event onRecordListPageMount ({orderType}), the values 0 for the registered records page and 1 for the contribution records page. Because the registered and contribution recording page UI are similar, the same set of events is used and distinguished by the orderType parameter.
After the event gets the data, set the data through the interface setRecordList (param), the parameter is Object, defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
list | Order Details | Array\ [Record] | Yes | Record is defined as follows |
hasNext | Is there a next page | boolean | No | True indicates that there is a next page of data. Rolling to the bottom triggers the paging event onRecordListNextPage. No paging can ignore this field |
errcode | return code | number | No | Whether or not to succeed, 0 means success, no default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
Record definition:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
orderId | Order id | string | yes | Both registration records and payment records pages are required |
patName | Patients | string | yes | Both registration records and payment records pages are required |
doctorName | Name of the doctor | string | yes | |
deptName | Name of department | string | yes | |
appointpmentTime | Time of appointment | string | yes | |
orderStatus | Order Status | number | yes | The orderType is 0h "10 - Registered to be paid;11 failed to register · there is a refund;12- A registered irregularity; 13 - Registration is in progress; 20 or 30 - paid successfully "orderType for 1" 10 - pending payment;11- Payment failed · refund is available;12- irregular payments; 20 or 30 - Payment was successful " |
rollbackStatus | Cancellation status | number | no | By default, 0 indicates successful registration |
rollbackFee | Cancellation Amount | string | no | RollbackStatus is not 0 valid |
payTime | Payment time | string | no | Payment time, Payment records page is valid |
payFee | Amount of contributions | number | no | The total amount of contributions, the contribution records page is valid, and the units are divided |
If hasNext is true, the user scrolling to the bottom triggers the onRecordListNextPage event, with the same parameter as onRecordListPageMount, at which the data on the next page is set by concatRecordList (param), with the same parameter as setRecordList.
When a user clicks on a certain item, they go to the registration details page (if the payment page goes to the payment details), triggering an event onPayPageMount. This event only comes with the orderId parameter. Please refer to the usage of this event. In addition, if you need to jump to the hospital's original registration details page, you can jump directly inside the event.
# 2 Payment process
# 2.1 Orders pending payment
The link to the page is https://hostname/path?query#/pay-fee-list
After entering the page, set the page data via setPayFeeList (params). The params data format is defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
list | Order Details | Array\ [PayFee] | Yes | PayFee is defined as follows |
hasNext | Is there a next page | boolean | No | True means there is a next page data. Rolling to the bottom will trigger a paging event onPayFeeListNextPage. No paging can ignore this field |
errcode | return code | number | No | Whether or not to succeed, 0 means success, no default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
PayFee is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
treatmentType | Type of outpatient clinic | String | yes | |
deptName | Diagnostic departments | String | yes | |
doctorName | doctor | String | yes | |
time | Opening time | String | yes | |
orderId | Outpatient flow numbers | String | yes | Unique ID, click "Go to Pay" will take you to the payment details page |
unpaidFee | Total costs | number | yes | The unit is yuan. |
Go to the page by clicking "go to pay" and you will be taken to the payment details page.
# 2.2 Payment details
Clicking on a contribution from the pending list or the contribution recording page will take you to this page. If your contribution has been completed, the buttons for out-of-pocket payments and Medicare payments will not appear.
Entering the page triggers onPayFeeDetailPageMount ({orderId}). The orderId is the outpatient stream number that is passed into the pay-pending page.The page sets the data by setPayFeeDetail (params). Params are defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
detail | Order Details | PayFeeOrderInfo | Yes | PayFeeOrderInfo is defined as follows |
errcode | return code | number | No | Whether or not to succeed, 0 means success, no default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
PayFeeOrderInfo Type Definition:
Field Name | describe | type | Required to fill in | Remarks |
---|---|---|---|---|
orderId | Order ID | String | yes | Outpatient Payment Flow Number |
patName | Name of the patient | String | yes | |
visitingTypeName | Type of visit | String | yes | Valued as "self-funded," "medical insurance," "provincial medical insurance," "municipal medical insurance," and "other" |
deptId | Department ID | String | no | Use for reporting |
deptName | Name of department | String | yes | |
doctorId | Doctor ID | String | no | Use for reporting |
doctorName | Name of the doctor | String | yes | |
fee | Total amount paid | String | yes | For example, "0.1" |
hospName | Name of Campus | String | yes | |
prescribeTime | Date of visit | String | yes | Outpatient Payment Flow Number |
orderStatus | Order Status | Number | yes | The value is as follows: 10 - payment pending, 11 - payment failing with a refund, 12 - payment unusual, 20 / 30 - payment succeeded |
payFailMsg | Reasons for the failure of payment | String | no | Required in case of failure to pay |
supportCertPay | Does it support health care payments? | Boolean | no | Default is true |
cardNumber | Appointment card number | String | yes | Valid when the orderStatus is 20 |
notice | A warm reminder | String | yes | Valid when the orderStatus is 20 |
bills | Outpatient costs | Array | no | Details of outpatient contributions |
prescriptions | Payment prescription form | Array | no | And bills, which is a list of prescriptions |
Note: Choose one of the two fields for bills and prescriptions. If you are paying by prescription, you will pass the prescriptions field.
The bill type is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
projectName | Name of contribution project | String | yes | |
uintPrice | Unit Price | number | yes | |
projectAmount | Number | String | yes | |
totalPrice | Total Amount | String | yes | Unit of "yuan" |
The Prescription type is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
id | Prescription Number | String | yes | |
doctorName | Name of the doctor | String | yes | |
time | Opening time | String | yes | Format the time well |
deptName | Name of department | String | yes | |
totalPrice | Total Amount | String | yes | Total price, unit of "yuan" |
projects | List of fee items | Array|yes | FeeProject is defined as follows |
The FeeProject type is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
projectName | Name of contribution project | String | yes | |
uintPrice | Unit Price | number | yes | |
projectAmount | Number | String | yes | Unit of "yuan" |
Click Pay Yourself to trigger the event onPayFeeDetailPayOrder (detail), which is of type PayFeeOrderInfo. Click on Medicare Payment to trigger the event onPayFeeDetailCertPayOrder (detail), which is also a PayFeeOrderInfo type.
If you choose to pay by prescription, the event parameter detail.prescriptions\ [0].checked attribute is true, and the developer needs to calculate the total price checked by the user to pay from this field.The interaction of payment by prescription note is as follows
In these events, you can place a payment, pull up WeChat payment / health care payment, etc., and update the payment result by updatePayFeeDetail (params), which is defined like setPayFeeDetail, except that detail can only be sent to the modified field, such as orderStatus.
If a payment fails, you can display the error pop-up via setPayFeeErrorInfo (params), defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
errcode | error code | number | is | successful, 0 means success, not fill in the default means success |
errmsg | Error Message | String | Yes | When the errcode is not 0, this field indicates the error message. The front end will display this error message |
# 2.3 Personal Center
The link to the page is https://hostname/path?query#/personal-center
Clicking on registered records will jump to the registered recording page in section 9 above. Clicking on payroll records will move to the payroll page in the next section. By default, you will jump past the URL parameter of the page.
# 2.4 Payment records
Because the UI is similar to a subscription record and a registered record, the interface is similar to the registered record page, except that the recordType takes a value of 1, and the definition of the Record object is not the same. Only a note that the subscription record is valid or both are the fields required for this page. Also note that this page is displayed only as a record of paid contributions. Orders pending payments are displayed on the page in section 10.
# 3 Report queries
# 3.1 Select the type of report
The link to the page is https://hostname/path?query#/report-type
# 3.2 A report has been issued
The link to the page is https://hostname/path?query#/report-list?type=1
When type 1 indicates the jump from the inspection report, type 2 indicates the jump from the inspection report.
Entering a published report page triggers the onReportListPageMount ({pageIndex, pageSize, days}) event. Pageindex and pageSize are paging parameters.Days is the number of days in the report currently displayed, for example, days in the most recent week were 7. The list data of the report can be set through the setReportList (params) interface, which is defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
list | Report list | Array\ [Report] | Yes | Report is defined as follows |
hasNext | Is there a next page | boolean | No | True means there is a next page data. Rolling to the bottom will trigger the paging event onReportListNextPage. No paging can ignore this field |
errcode | return code | number | No | Whether or not to succeed, 0 means success, no default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
Report is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
reportName | Name of report | String | yes | Name of report |
inspectTime | Check Time | String | yes | The format of the time is YYYY-MM-DDHH: SS |
reportId | Report ID | String | yes | Report unique ID, which will be taken to the report details page |
reportType | Type of report | number | yes | A test report with a value of 1 and a check report with values of 2 will take you to the report details page |
Clicking on the query date above triggers an event onReportDateClick ({days, pageIndex, pageSize}) in which the data is pulled back.Days is the date selected by the user, if all is selected, the value of days is 0 and needs special treatment.
Clicking on an item in the report below triggers an event onReportItemClick (item) ,The parameter item is the above Report object, which can be handled in this event if you need to jump to your own report details page.
# 3.3 Details of the report
Entering this page triggers the event onReportDetailPageMount ({reportId, reportType}). Reportid is the id of the report. The definition of reportType is explained in the section above.This page gets the detailed data for the report and is set through the setReportDetail (params) interface, which is defined as follows:
Field Name | Parameter Description | Parameter Type | Required | Notes |
---|---|---|---|---|
reportDetail | Report Details Information | ReportDetail | Yes | ReportDetail is defined as follows |
errcode | return code | number | No | Whether or not to succeed, 0 means success, no default means success |
errmsg | Error Message | String | No | When the errcode is not 0, this field indicates the error message and the front end displays this error message |
ReportDetail is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
outpatientDetail | Information on visits | OutpatientDetail | yes | OutpatientDetail is defined as follows |
list | Report content | Array|ReportInspectContent> | yes | When type 1, each item in the array is ReportInspectContent, and when type 2, each item in the array is ReportCheckContent |
type | Type of report | number | yes | Define the same reportType as above. The test report has a value of 1, and the inspection report has values of 2. |
OutpatientDetail is defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
patName | Patients | String | yes | |
deptName | Opening department | String | yes | |
doctorName | The prescribing doctor | String | yes | |
inspectTime | Reporting Time | String | yes | |
reportId | Report Number | String | yes |
The contents of the inspection report ReportInspectContent are defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
itemName | Project Name | String | yes | |
refRange | Reference values | String | yes | |
result | Result | String | yes |
The contents of the check report ReportCheckContent are defined as follows:
Field Name | Parameter description | Parameter Type | Required to fill in | Remarks |
---|---|---|---|---|
checkPart | Locations to be examined | String | yes | |
checkSituation | What I saw was examined | String | yes | |
option | Diagnostic opinion | String | yes | |
advice | prescription | String | yes | |
checkMethod | Methods of inspection | String | yes |
# 4 Customize page color and button display
Through elderMedicalSDK.setOptions (options) ,You can set some options on the page, such as some colors of the page, registration details page, whether to display the button to cancel registration, the structure of the parameter options can be referred to:
if (elderMedicalSDK.setOptions) {
elderMedicalSDK.setOptions({
autoJumpReportDetail: false, // 报告列表页面,是否自动跳转报告详情页面
showCancelOrder: false, // 挂号详情页面,是否显示取消挂号,默认是true表示显示
notice: {
checkedBgColor: 'red', // 就医须知-勾选框颜色
btnBgColor: 'red' // 就医须知-按钮背景色
},
chooseDoctor: {
chooseDateBgColor: 'red', // 选择医生-当前日期背景色
recentTagColor: 'blue', // 选择医生-最近就诊字体颜色
chooseDateColor: 'red', // 选择医生-日期有号文字颜色
canRegColor: 'green', // 选择医生-剩余号数量颜色
chooseDateColor: 'blue', // 选择医生-已满颜色
},
choosePeriod: {
color: 'red', // 选择就诊时段-文字颜色
},
payDetail: {
btnBgColor: 'red' // 确认挂号-按钮背景色
},
ignoreNoticePage: false, // 是否跳过就医须知页面
})
}
For specific fields, see the screenshot below
# 5 Set the page loading status
Support starting with version 0.1.8
The default loading of the page is 1 s to disappear, via elderMedicalSDK.setOptions({manualHideLoading:{}}) , which can manually set the loading status of the page, currently supports the report list page:
if (elderMedicalSDK.setOptions) {
elderMedicalSDK.setOptions({
manualHideLoading: {
reportList: true, // 报告列表页面,手动隐藏loading
}
})
}
You can then hide the loading in the onReportListPageMount callback by elderMedicalSDK.setHideLoading ()
# 6 Win window styles
Support starting with version 0.2.0
# 6.1 Basic panes
elderMedicalSDK.setDialogInfo({
show: true,
title: '标题',
content: '内容',
showCancel: false, // 是否显示取消按钮
cancelText: '取消',
confirmText: '确定',
cancel: function() { // 点击取消按钮触发
console.log('dialogInfo dialog cancel')
},
confirm: function() { // 点击确定按钮触发
console.log('dialogInfo dialog confirm')
}
})
# 6.2 A semi-screen pop-up window
elderMedicalSDK.setHalfDialogInfo({
show: false,
title: '标题',
content: '内容',
showCancel: false,
cancelText: '取消',
confirmText: '我知道了',
confirmColor: 'red', // 确定按钮的文本色
checkedColor: 'red', // 勾选框的颜色
confirmBackgroundColor: 'red', // 确定按钮的背景色
close: function() { // 关闭半屏弹窗触发
console.log('HalfDialogInfo dialog close')
},
cancel: function() { // 点击取消按钮触发
console.log('HalfDialogInfo dialog cancel')
},
confirm: function() { // 点击确定按钮触发
console.log('HalfDialogInfo dialog confirm')
}
})
# 7 About JSSDK
Developers need to call wx.config to initiate JSSDK and notify the SDK that it is ready by elderMedicalSDK.jssdkReady () .The initial parameter jsapiList needs to pass the interface hideAllNonBaseMenuItem, which needs to be called in the SDK. For example:
wx.config({
jsapiList: ["hideAllNonBaseMenuItem"],
// ...
})
wx.ready(function() {
elderMedicalSDK.jssdkReady()
})