|
@@ -1254,8 +1254,24 @@ func (c *HisApiController) GetRegisterInfo() {
|
1254
|
1254
|
id, _ := c.GetInt64("id")
|
1255
|
1255
|
record_time := c.GetString("record_time")
|
1256
|
1256
|
|
|
1257
|
+ name := c.GetString("name")
|
|
1258
|
+ gender, _ := c.GetInt64("gender")
|
|
1259
|
+ age, _ := c.GetInt64("age")
|
|
1260
|
+ birthday := c.GetString("birthday")
|
|
1261
|
+ phone := c.GetString("phone")
|
|
1262
|
+ medical_care, _ := c.GetInt64("medical_care")
|
|
1263
|
+ id_card := c.GetString("id_card")
|
|
1264
|
+ register_type, _ := c.GetInt64("register_type")
|
|
1265
|
+ registration_fee, _ := c.GetFloat("registration_fee")
|
|
1266
|
+ medical_expenses, _ := c.GetFloat("medical_expenses")
|
|
1267
|
+ certificates, _ := c.GetInt64("certificates")
|
|
1268
|
+ settlementValue, _ := c.GetInt64("settlement_value")
|
|
1269
|
+ social_type, _ := c.GetInt64("social_type")
|
|
1270
|
+ medical_insurance_card := c.GetString("medical_insurance_card")
|
1257
|
1271
|
timeLayout := "2006-01-02"
|
1258
|
1272
|
loc, _ := time.LoadLocation("Local")
|
|
1273
|
+ birthdays, _ := time.ParseInLocation(timeLayout+" 15:04:05", birthday+" 00:00:00", loc)
|
|
1274
|
+ birthUnix := birthdays.Unix()
|
1259
|
1275
|
|
1260
|
1276
|
theTime, err := time.ParseInLocation(timeLayout+" 15:04:05", record_time+" 00:00:00", loc)
|
1261
|
1277
|
if err != nil {
|
|
@@ -1454,28 +1470,43 @@ func (c *HisApiController) GetRegisterInfo() {
|
1454
|
1470
|
}
|
1455
|
1471
|
|
1456
|
1472
|
} else {
|
|
1473
|
+ timeStr := time.Now().Format("2006-01-02")
|
|
1474
|
+ timeArr := strings.Split(timeStr, "-")
|
|
1475
|
+ var str = timeArr[0] + timeArr[1] + timeArr[2] + strconv.FormatInt(patient.ID, 10)
|
1457
|
1476
|
|
1458
|
1477
|
his, err := service.GetHisPatientInfo(adminInfo.CurrentOrgId, patient.ID, recordDateTime)
|
|
1478
|
+ var hisPatient models.XtHisPatient
|
1459
|
1479
|
if err == gorm.ErrRecordNotFound || his.ID == 0 {
|
1460
|
|
- patient := models.XtHisPatient{
|
1461
|
|
- Age: patient.Age,
|
1462
|
|
- Birthday: patient.Birthday,
|
1463
|
|
- AdminUserId: adminInfo.AdminUser.Id,
|
1464
|
|
- IdCardNo: patient.IdCardNo,
|
1465
|
|
- Name: patient.Name,
|
1466
|
|
- Gender: patient.Gender,
|
1467
|
|
- UserOrgId: adminInfo.CurrentOrgId,
|
1468
|
|
- Status: 1,
|
1469
|
|
- RecordDate: recordDateTime,
|
1470
|
|
- IsReturn: 1,
|
1471
|
|
- PatientId: patient.ID,
|
1472
|
|
- Ctime: time.Now().Unix(),
|
1473
|
|
- Mtime: time.Now().Unix(),
|
|
1480
|
+ hisPatient = models.XtHisPatient{
|
|
1481
|
+ Name: name,
|
|
1482
|
+ Age: age,
|
|
1483
|
+ Gender: gender,
|
|
1484
|
+ Birthday: birthUnix,
|
|
1485
|
+ Phone: phone,
|
|
1486
|
+ MedicalTreatmentType: medical_care,
|
|
1487
|
+ IdType: certificates,
|
|
1488
|
+ IdCardNo: id_card,
|
|
1489
|
+ BalanceAccountsType: settlementValue,
|
|
1490
|
+ SocialType: social_type,
|
|
1491
|
+ MedicalInsuranceNumber: medical_insurance_card,
|
|
1492
|
+ RegisterType: register_type,
|
|
1493
|
+ RegisterCost: registration_fee,
|
|
1494
|
+ TreatmentCost: medical_expenses,
|
|
1495
|
+ AdminUserId: adminInfo.AdminUser.Id,
|
|
1496
|
+ UserOrgId: adminInfo.CurrentOrgId,
|
|
1497
|
+ Status: 1,
|
|
1498
|
+ RecordDate: recordDateTime,
|
|
1499
|
+ IsReturn: 1,
|
|
1500
|
+ PatientId: patient.ID,
|
|
1501
|
+ Ctime: time.Now().Unix(),
|
|
1502
|
+ Mtime: time.Now().Unix(),
|
|
1503
|
+ Number: str,
|
1474
|
1504
|
}
|
1475
|
|
- service.CreateHisPatient(&patient)
|
|
1505
|
+ service.CreateHisPatient(&hisPatient)
|
|
1506
|
+
|
1476
|
1507
|
}
|
1477
|
1508
|
c.ServeSuccessJSON(map[string]interface{}{
|
1478
|
|
- "his_info": patient,
|
|
1509
|
+ "his_info": hisPatient,
|
1479
|
1510
|
})
|
1480
|
1511
|
|
1481
|
1512
|
}
|
|
@@ -1486,6 +1517,17 @@ func (c *HisApiController) GetRegisterInfo() {
|
1486
|
1517
|
func (c *HisApiController) GetUploadInfo() {
|
1487
|
1518
|
id, _ := c.GetInt64("id")
|
1488
|
1519
|
record_time := c.GetString("record_time")
|
|
1520
|
+
|
|
1521
|
+ pay_way, _ := c.GetInt64("pay_way")
|
|
1522
|
+ pay_price, _ := c.GetFloat("pay_price")
|
|
1523
|
+ pay_card_no := c.GetString("pay_card_no")
|
|
1524
|
+ discount_price, _ := c.GetFloat("discount_price")
|
|
1525
|
+ preferential_price, _ := c.GetFloat("preferential_price")
|
|
1526
|
+ reality_price, _ := c.GetFloat("reality_price")
|
|
1527
|
+ found_price, _ := c.GetFloat("found_price")
|
|
1528
|
+ medical_insurance_price, _ := c.GetFloat("medical_insurance_price")
|
|
1529
|
+ private_price, _ := c.GetFloat("private_price")
|
|
1530
|
+
|
1489
|
1531
|
timeLayout := "2006-01-02"
|
1490
|
1532
|
loc, _ := time.LoadLocation("Local")
|
1491
|
1533
|
|
|
@@ -1560,21 +1602,30 @@ func (c *HisApiController) GetUploadInfo() {
|
1560
|
1602
|
|
1561
|
1603
|
if res.Infcode == 0 {
|
1562
|
1604
|
order := &models.HisOrder{
|
1563
|
|
- UserOrgId: adminUser.CurrentOrgId,
|
1564
|
|
- HisPatientId: his.ID,
|
1565
|
|
- PatientId: his.PatientId,
|
1566
|
|
- SettleAccountsDate: recordDateTime,
|
1567
|
|
- Ctime: time.Now().Unix(),
|
1568
|
|
- Mtime: time.Now().Unix(),
|
1569
|
|
- Status: 1,
|
1570
|
|
- Number: chrg_bchno,
|
1571
|
|
- Infcode: res.Infcode,
|
1572
|
|
- WarnMsg: res.WarnMsg,
|
1573
|
|
- Cainfo: res.Cainfo,
|
1574
|
|
- ErrMsg: res.ErrMsg,
|
1575
|
|
- RespondTime: res.RefmsgTime,
|
1576
|
|
- InfRefmsgid: res.InfRefmsgid,
|
1577
|
|
- OrderStatus: 1,
|
|
1605
|
+ UserOrgId: adminUser.CurrentOrgId,
|
|
1606
|
+ HisPatientId: his.ID,
|
|
1607
|
+ PatientId: his.PatientId,
|
|
1608
|
+ SettleAccountsDate: recordDateTime,
|
|
1609
|
+ Ctime: time.Now().Unix(),
|
|
1610
|
+ Mtime: time.Now().Unix(),
|
|
1611
|
+ Status: 1,
|
|
1612
|
+ Number: chrg_bchno,
|
|
1613
|
+ Infcode: res.Infcode,
|
|
1614
|
+ WarnMsg: res.WarnMsg,
|
|
1615
|
+ Cainfo: res.Cainfo,
|
|
1616
|
+ ErrMsg: res.ErrMsg,
|
|
1617
|
+ RespondTime: res.RefmsgTime,
|
|
1618
|
+ InfRefmsgid: res.InfRefmsgid,
|
|
1619
|
+ OrderStatus: 1,
|
|
1620
|
+ PayWay: pay_way,
|
|
1621
|
+ PayPrice: pay_price,
|
|
1622
|
+ PayCardNo: pay_card_no,
|
|
1623
|
+ DiscountPrice: discount_price,
|
|
1624
|
+ PreferentialPrice: preferential_price,
|
|
1625
|
+ RealityPrice: reality_price,
|
|
1626
|
+ FoundPrice: found_price,
|
|
1627
|
+ MedicalInsurancePrice: medical_insurance_price,
|
|
1628
|
+ PrivatePrice: private_price,
|
1578
|
1629
|
}
|
1579
|
1630
|
err = service.CreateOrder(order)
|
1580
|
1631
|
if err != nil {
|
|
@@ -1788,16 +1839,25 @@ func (c *HisApiController) GetUploadInfo() {
|
1788
|
1839
|
allTotal := fmt.Sprintf("%.2f", total)
|
1789
|
1840
|
totals, _ := strconv.ParseFloat(allTotal, 64)
|
1790
|
1841
|
order := &models.HisOrder{
|
1791
|
|
- UserOrgId: adminUser.CurrentOrgId,
|
1792
|
|
- HisPatientId: his.ID,
|
1793
|
|
- PatientId: id,
|
1794
|
|
- SettleAccountsDate: recordDateTime,
|
1795
|
|
- Ctime: time.Now().Unix(),
|
1796
|
|
- Mtime: time.Now().Unix(),
|
1797
|
|
- Status: 1,
|
1798
|
|
- OrderStatus: 2,
|
1799
|
|
- Number: chrg_bchno,
|
1800
|
|
- MedfeeSumamt: totals,
|
|
1842
|
+ UserOrgId: adminUser.CurrentOrgId,
|
|
1843
|
+ HisPatientId: his.ID,
|
|
1844
|
+ PatientId: id,
|
|
1845
|
+ SettleAccountsDate: recordDateTime,
|
|
1846
|
+ Ctime: time.Now().Unix(),
|
|
1847
|
+ Mtime: time.Now().Unix(),
|
|
1848
|
+ Status: 1,
|
|
1849
|
+ OrderStatus: 2,
|
|
1850
|
+ Number: chrg_bchno,
|
|
1851
|
+ MedfeeSumamt: totals,
|
|
1852
|
+ PayWay: pay_way,
|
|
1853
|
+ PayPrice: pay_price,
|
|
1854
|
+ PayCardNo: pay_card_no,
|
|
1855
|
+ DiscountPrice: discount_price,
|
|
1856
|
+ PreferentialPrice: preferential_price,
|
|
1857
|
+ RealityPrice: reality_price,
|
|
1858
|
+ FoundPrice: found_price,
|
|
1859
|
+ MedicalInsurancePrice: medical_insurance_price,
|
|
1860
|
+ PrivatePrice: private_price,
|
1801
|
1861
|
}
|
1802
|
1862
|
err = service.CreateOrder(order)
|
1803
|
1863
|
if err != nil {
|