|
@@ -60,6 +60,11 @@ func DoctorApiRegistRouters() {
|
60
|
60
|
beego.Router("/api/patient/updatehospitalsummary", &DoctorsApiController{}, "Post:UpdateHospitalSummary")
|
61
|
61
|
beego.Router("/api/patient/deletehospitalsummary", &DoctorsApiController{}, "Get:DeleteHospitalSummary")
|
62
|
62
|
beego.Router("/api/patient/getpatientinfo", &DoctorsApiController{}, "Get:GetPatientInfo")
|
|
63
|
+ beego.Router("/api/patient/createfirstdisease", &DoctorsApiController{}, "Post:CreateFirstDisease")
|
|
64
|
+ beego.Router("/api/patient/getfirstdiseaselist", &DoctorsApiController{}, "Get:GetFirstDiseaseList")
|
|
65
|
+ beego.Router("/api/patient/getfirstdetailbyid", &DoctorsApiController{}, "Get:GetFirstDetailById")
|
|
66
|
+ beego.Router("/api/patient/updatefirstdisease", &DoctorsApiController{}, "Post:UpdateFirstDisease")
|
|
67
|
+ beego.Router("/api/patient/deletefirstdisease", &DoctorsApiController{}, "Get:DeleteFirstDisease")
|
63
|
68
|
}
|
64
|
69
|
|
65
|
70
|
func (c *DoctorsApiController) ScheduleAdvices() {
|
|
@@ -1455,3 +1460,148 @@ func (c *DoctorsApiController) GetScheduleAdvicesList() {
|
1455
|
1460
|
}
|
1456
|
1461
|
|
1457
|
1462
|
}
|
|
1463
|
+
|
|
1464
|
+func (c *DoctorsApiController) CreateFirstDisease() {
|
|
1465
|
+
|
|
1466
|
+ timeLayout := "2006-01-02"
|
|
1467
|
+ loc, _ := time.LoadLocation("Local")
|
|
1468
|
+ dataBody := make(map[string]interface{}, 0)
|
|
1469
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
1470
|
+ fmt.Print("err", err)
|
|
1471
|
+
|
|
1472
|
+ doctor := int64(dataBody["doctor"].(float64))
|
|
1473
|
+ record_date := dataBody["record_date"].(string)
|
|
1474
|
+ recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
1475
|
+ recordtime := recordDates.Unix()
|
|
1476
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
1477
|
+ title := dataBody["title"].(string)
|
|
1478
|
+ main_content := dataBody["main_content"].(string)
|
|
1479
|
+ patient_case := dataBody["patient_case"].(string)
|
|
1480
|
+ tentative_diagnosis := dataBody["tentative_diagnosis"].(string)
|
|
1481
|
+ diagnostic_basis := dataBody["diagnostic_basis"].(string)
|
|
1482
|
+ differential_diagnosis := dataBody["differential_diagnosis"].(string)
|
|
1483
|
+ treatment_plan := dataBody["treatment_plan"].(string)
|
|
1484
|
+
|
|
1485
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
1486
|
+ firstdisease := models.XtPatientFirstDisease{
|
|
1487
|
+ Title: title,
|
|
1488
|
+ RecordDate: recordtime,
|
|
1489
|
+ Doctor: doctor,
|
|
1490
|
+ MainContent: main_content,
|
|
1491
|
+ PatientCase: patient_case,
|
|
1492
|
+ TentativeDiagnosis: tentative_diagnosis,
|
|
1493
|
+ DiagnosticBasis: diagnostic_basis,
|
|
1494
|
+ DifferentialDiagnosis: differential_diagnosis,
|
|
1495
|
+ TreatmentPlan: treatment_plan,
|
|
1496
|
+ UserOrgId: orgId,
|
|
1497
|
+ PatientId: patient_id,
|
|
1498
|
+ Ctime: time.Now().Unix(),
|
|
1499
|
+ Mtime: 0,
|
|
1500
|
+ Status: 1,
|
|
1501
|
+ }
|
|
1502
|
+
|
|
1503
|
+ error := service.CreatePatientFirstDisease(firstdisease)
|
|
1504
|
+ fmt.Println("err-------", error)
|
|
1505
|
+ if error == nil {
|
|
1506
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1507
|
+ "firstDisease": firstdisease,
|
|
1508
|
+ })
|
|
1509
|
+ }
|
|
1510
|
+}
|
|
1511
|
+
|
|
1512
|
+func (c *DoctorsApiController) GetFirstDiseaseList() {
|
|
1513
|
+
|
|
1514
|
+ timeLayout := "2006-01-02"
|
|
1515
|
+ loc, _ := time.LoadLocation("Local")
|
|
1516
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
1517
|
+ patient_id, _ := c.GetInt64("patient_id")
|
|
1518
|
+ start_time := c.GetString("start_time")
|
|
1519
|
+
|
|
1520
|
+ dischargeTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", start_time+" 00:00:00", loc)
|
|
1521
|
+ startime := dischargeTimes.Unix()
|
|
1522
|
+
|
|
1523
|
+ end_time := c.GetString("end_time")
|
|
1524
|
+ endTimes, _ := time.ParseInLocation(timeLayout+" 15:04:05", end_time+" 00:00:00", loc)
|
|
1525
|
+ endtime := endTimes.Unix()
|
|
1526
|
+ list, err := service.GetPatientDiseaseList(orgId, patient_id, startime, endtime)
|
|
1527
|
+ if err == nil {
|
|
1528
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1529
|
+ "list": list,
|
|
1530
|
+ })
|
|
1531
|
+ return
|
|
1532
|
+ }
|
|
1533
|
+}
|
|
1534
|
+
|
|
1535
|
+func (c *DoctorsApiController) GetFirstDetailById() {
|
|
1536
|
+
|
|
1537
|
+ id, _ := c.GetInt64("id")
|
|
1538
|
+ list, err := service.GetFirstDetailById(id)
|
|
1539
|
+ if err == nil {
|
|
1540
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1541
|
+ "detail": list,
|
|
1542
|
+ })
|
|
1543
|
+ return
|
|
1544
|
+ }
|
|
1545
|
+}
|
|
1546
|
+
|
|
1547
|
+func (c *DoctorsApiController) UpdateFirstDisease() {
|
|
1548
|
+
|
|
1549
|
+ timeLayout := "2006-01-02"
|
|
1550
|
+ loc, _ := time.LoadLocation("Local")
|
|
1551
|
+ dataBody := make(map[string]interface{}, 0)
|
|
1552
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
1553
|
+ fmt.Print("err", err)
|
|
1554
|
+ id := int64(dataBody["id"].(float64))
|
|
1555
|
+ doctor := int64(dataBody["doctor"].(float64))
|
|
1556
|
+ record_date := dataBody["record_date"].(string)
|
|
1557
|
+ recordDates, _ := time.ParseInLocation(timeLayout+" 15:04:05", record_date+" 00:00:00", loc)
|
|
1558
|
+ recordtime := recordDates.Unix()
|
|
1559
|
+ patient_id := int64(dataBody["patient_id"].(float64))
|
|
1560
|
+ title := dataBody["title"].(string)
|
|
1561
|
+ main_content := dataBody["main_content"].(string)
|
|
1562
|
+ patient_case := dataBody["patient_case"].(string)
|
|
1563
|
+ tentative_diagnosis := dataBody["tentative_diagnosis"].(string)
|
|
1564
|
+ diagnostic_basis := dataBody["diagnostic_basis"].(string)
|
|
1565
|
+ differential_diagnosis := dataBody["differential_diagnosis"].(string)
|
|
1566
|
+ treatment_plan := dataBody["treatment_plan"].(string)
|
|
1567
|
+
|
|
1568
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
1569
|
+ firstdisease := models.XtPatientFirstDisease{
|
|
1570
|
+ Title: title,
|
|
1571
|
+ RecordDate: recordtime,
|
|
1572
|
+ Doctor: doctor,
|
|
1573
|
+ MainContent: main_content,
|
|
1574
|
+ PatientCase: patient_case,
|
|
1575
|
+ TentativeDiagnosis: tentative_diagnosis,
|
|
1576
|
+ DiagnosticBasis: diagnostic_basis,
|
|
1577
|
+ DifferentialDiagnosis: differential_diagnosis,
|
|
1578
|
+ TreatmentPlan: treatment_plan,
|
|
1579
|
+ UserOrgId: orgId,
|
|
1580
|
+ PatientId: patient_id,
|
|
1581
|
+ Ctime: time.Now().Unix(),
|
|
1582
|
+ Mtime: 0,
|
|
1583
|
+ Status: 1,
|
|
1584
|
+ ID: id,
|
|
1585
|
+ }
|
|
1586
|
+
|
|
1587
|
+ error := service.UpdatePatientFirstDisease(firstdisease, id)
|
|
1588
|
+
|
|
1589
|
+ if error == nil {
|
|
1590
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
1591
|
+ "firstDisease": firstdisease,
|
|
1592
|
+ })
|
|
1593
|
+ }
|
|
1594
|
+
|
|
1595
|
+}
|
|
1596
|
+
|
|
1597
|
+func (c *DoctorsApiController) DeleteFirstDisease() {
|
|
1598
|
+
|
|
1599
|
+ schIDStr := c.GetString("ids")
|
|
1600
|
+ idStrs := strings.Split(schIDStr, ",")
|
|
1601
|
+ err := service.DeleteFirstDisease(idStrs)
|
|
1602
|
+ fmt.Println(err)
|
|
1603
|
+ returnData := make(map[string]interface{}, 0)
|
|
1604
|
+ returnData["msg"] = "ok"
|
|
1605
|
+ c.ServeSuccessJSON(returnData)
|
|
1606
|
+ return
|
|
1607
|
+}
|