|
@@ -141,6 +141,8 @@ func PatientApiRegistRouters() {
|
141
|
141
|
|
142
|
142
|
beego.Router("/api/patient/savepatientcriticalcalinformedone", &PatientApiController{}, "Post:SavePatientCriticalInformedOne")
|
143
|
143
|
|
|
144
|
+ beego.Router("/api/patient/getpatientcriticalonelist", &PatientApiController{}, "Get:GetPatientCriticalOneList")
|
|
145
|
+
|
144
|
146
|
}
|
145
|
147
|
func (c *PatientApiController) GetExportList() {
|
146
|
148
|
startTime := c.GetString("start_time")
|
|
@@ -6734,4 +6736,43 @@ func (c *PatientApiController) GetPatientCriticalList() {
|
6734
|
6736
|
|
6735
|
6737
|
func (c *PatientApiController) SavePatientCriticalInformedOne() {
|
6736
|
6738
|
|
|
6739
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
6740
|
+ dataBody := make(map[string]interface{}, 0)
|
|
6741
|
+ err := json.Unmarshal(c.Ctx.Input.RequestBody, &dataBody)
|
|
6742
|
+ fmt.Println("err", err)
|
|
6743
|
+ content := dataBody["content"].(string)
|
|
6744
|
+
|
|
6745
|
+ criticalOne := models.XtPatientCriticalOne{
|
|
6746
|
+ UserOrgId: orgId,
|
|
6747
|
+ Content: content,
|
|
6748
|
+ Status: 1,
|
|
6749
|
+ Ctime: time.Now().Unix(),
|
|
6750
|
+ Mtime: time.Now().Unix(),
|
|
6751
|
+ }
|
|
6752
|
+
|
|
6753
|
+ critical, _ := service.GetPatientCriticalByUserOrgId(orgId)
|
|
6754
|
+
|
|
6755
|
+ if critical.ID == 0 {
|
|
6756
|
+ service.CreatePatientCritical(criticalOne)
|
|
6757
|
+ }
|
|
6758
|
+
|
|
6759
|
+ if critical.ID > 0 {
|
|
6760
|
+ service.UpdatePatientCriticalOne(orgId, content)
|
|
6761
|
+ }
|
|
6762
|
+
|
|
6763
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
6764
|
+ "criticalOne": criticalOne,
|
|
6765
|
+ })
|
|
6766
|
+
|
|
6767
|
+}
|
|
6768
|
+
|
|
6769
|
+func (c *PatientApiController) GetPatientCriticalOneList() {
|
|
6770
|
+
|
|
6771
|
+ orgId := c.GetAdminUserInfo().CurrentOrgId
|
|
6772
|
+
|
|
6773
|
+ list, _ := service.GetPatientCriticalOneList(orgId)
|
|
6774
|
+
|
|
6775
|
+ c.ServeSuccessJSON(map[string]interface{}{
|
|
6776
|
+ "list": list,
|
|
6777
|
+ })
|
6737
|
6778
|
}
|