|
@@ -328,9 +328,9 @@ func MobileGetSchedualDetailOne(orgID int64, patientID int64) (*MDialysisSchedul
|
328
|
328
|
}
|
329
|
329
|
|
330
|
330
|
// 接诊评估
|
331
|
|
-func MobileGetReceiverTreatmentAccessRecordOne(orgID int64, patientID int64) (*models.ReceiveTreatmentAsses, error) {
|
|
331
|
+func MobileGetReceiverTreatmentAccessRecordOne(orgID int64, patientID int64, record_date int64) (*models.ReceiveTreatmentAsses, error) {
|
332
|
332
|
var record models.ReceiveTreatmentAsses
|
333
|
|
- err = readDb.Model(&models.ReceiveTreatmentAsses{}).Where("patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).Last(&record).Error
|
|
333
|
+ err = readDb.Model(&models.ReceiveTreatmentAsses{}).Where("patient_id = ? and user_org_id = ? and status = 1 and record_date = ?", patientID, orgID, record_date).Find(&record).Error
|
334
|
334
|
if err != nil {
|
335
|
335
|
if err == gorm.ErrRecordNotFound {
|
336
|
336
|
return nil, nil
|
|
@@ -342,9 +342,9 @@ func MobileGetReceiverTreatmentAccessRecordOne(orgID int64, patientID int64) (*m
|
342
|
342
|
}
|
343
|
343
|
|
344
|
344
|
// 透前评估
|
345
|
|
-func MobileGetPredialysisEvaluationOne(orgID int64, patientID int64) (*models.PredialysisEvaluation, error) {
|
|
345
|
+func MobileGetPredialysisEvaluationOne(orgID int64, patientID int64, assessment_date int64) (*models.PredialysisEvaluation, error) {
|
346
|
346
|
var record models.PredialysisEvaluation
|
347
|
|
- err := readDb.Model(&models.PredialysisEvaluation{}).Where("patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).Last(&record).Error
|
|
347
|
+ err := readDb.Model(&models.PredialysisEvaluation{}).Where("patient_id = ? and user_org_id = ? and status = 1 and assessment_date = ?", patientID, orgID, assessment_date).Find(&record).Error
|
348
|
348
|
if err != nil {
|
349
|
349
|
if err == gorm.ErrRecordNotFound {
|
350
|
350
|
return nil, nil
|
|
@@ -385,9 +385,9 @@ func MobileGetDoctorAdvicesByGroupsOne(orgID int64, patientID int64, advicedate
|
385
|
385
|
}
|
386
|
386
|
|
387
|
387
|
// 透析记录
|
388
|
|
-func MobileGetSchedualDialysisRecordOne(orgID int64, patientID int64) (*models.DialysisOrder, error) {
|
|
388
|
+func MobileGetSchedualDialysisRecordOne(orgID int64, patientID int64, dialysis_date int64) (*models.DialysisOrder, error) {
|
389
|
389
|
var record models.DialysisOrder
|
390
|
|
- err := readDb.Model(&models.DialysisOrder{}).Preload("DeviceNumber", "org_id = ? AND status = 1", orgID).Where("user_org_id = ? AND patient_id = ?", orgID, patientID).Last(&record).Error
|
|
390
|
+ err := readDb.Model(&models.DialysisOrder{}).Preload("DeviceNumber", "org_id = ? AND status = 1 and dialysis_date = ?", orgID, dialysis_date).Where("user_org_id = ? AND patient_id = ?", orgID, patientID).Find(&record).Error
|
391
|
391
|
if err != nil {
|
392
|
392
|
if err == gorm.ErrRecordNotFound {
|
393
|
393
|
return nil, nil
|
|
@@ -399,9 +399,9 @@ func MobileGetSchedualDialysisRecordOne(orgID int64, patientID int64) (*models.D
|
399
|
399
|
}
|
400
|
400
|
|
401
|
401
|
// 双人核对
|
402
|
|
-func MobileGetDoubleCheckOne(orgID int64, patientID int64) (*models.DoubleCheck, error) {
|
|
402
|
+func MobileGetDoubleCheckOne(orgID int64, patientID int64, check_date int64) (*models.DoubleCheck, error) {
|
403
|
403
|
var record models.DoubleCheck
|
404
|
|
- err := readDb.Model(&models.DoubleCheck{}).Where("patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).Last(&record).Error
|
|
404
|
+ err := readDb.Model(&models.DoubleCheck{}).Where("patient_id = ? and user_org_id = ? and status = 1 and check_date = ?", patientID, orgID, check_date).Find(&record).Error
|
405
|
405
|
if err != nil {
|
406
|
406
|
if err == gorm.ErrRecordNotFound {
|
407
|
407
|
return nil, nil
|
|
@@ -413,9 +413,9 @@ func MobileGetDoubleCheckOne(orgID int64, patientID int64) (*models.DoubleCheck,
|
413
|
413
|
}
|
414
|
414
|
|
415
|
415
|
// 透析监测记录
|
416
|
|
-func MobileGetMonitorRecordsOne(orgID int64, patientID int64) ([]*models.MonitoringRecord, error) {
|
|
416
|
+func MobileGetMonitorRecordsOne(orgID int64, patientID int64, monitoring_date int64) ([]*models.MonitoringRecord, error) {
|
417
|
417
|
var records []*models.MonitoringRecord
|
418
|
|
- err := readDb.Model(&models.MonitoringRecord{}).Where("patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).Order("operate_time asc").Last(&records).Error
|
|
418
|
+ err := readDb.Model(&models.MonitoringRecord{}).Where("patient_id = ? and user_org_id = ? and status = 1 and monitoring_date = ?", patientID, orgID, monitoring_date).Order("operate_time asc").Find(&records).Error
|
419
|
419
|
if err != nil {
|
420
|
420
|
return nil, err
|
421
|
421
|
}
|
|
@@ -436,9 +436,9 @@ func MobileGetLastMonitorRecordOne(orgID int64, patientID int64) (*models.Monito
|
436
|
436
|
}
|
437
|
437
|
|
438
|
438
|
// 透后评估
|
439
|
|
-func MobileGetAssessmentAfterDislysisOne(orgID int64, patientID int64) (*models.AssessmentAfterDislysis, error) {
|
|
439
|
+func MobileGetAssessmentAfterDislysisOne(orgID int64, patientID int64, assessment_date int64) (*models.AssessmentAfterDislysis, error) {
|
440
|
440
|
var record models.AssessmentAfterDislysis
|
441
|
|
- err := readDb.Model(&models.AssessmentAfterDislysis{}).Where("patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).Last(&record).Error
|
|
441
|
+ err := readDb.Model(&models.AssessmentAfterDislysis{}).Where("patient_id = ? and user_org_id = ? and status = 1 and assessment_date =? ", patientID, orgID, assessment_date).Find(&record).Error
|
442
|
442
|
if err != nil {
|
443
|
443
|
if err == gorm.ErrRecordNotFound {
|
444
|
444
|
return nil, nil
|
|
@@ -450,9 +450,9 @@ func MobileGetAssessmentAfterDislysisOne(orgID int64, patientID int64) (*models.
|
450
|
450
|
}
|
451
|
451
|
|
452
|
452
|
// 治疗小结
|
453
|
|
-func MobileGetTreatmentSummaryOne(orgID int64, patientID int64) (*models.TreatmentSummary, error) {
|
|
453
|
+func MobileGetTreatmentSummaryOne(orgID int64, patientID int64, assessment_date int64) (*models.TreatmentSummary, error) {
|
454
|
454
|
var record models.TreatmentSummary
|
455
|
|
- err := readDb.Model(&models.TreatmentSummary{}).Where("patient_id = ? and user_org_id = ? and status = 1", patientID, orgID).Last(&record).Error
|
|
455
|
+ err := readDb.Model(&models.TreatmentSummary{}).Where("patient_id = ? and user_org_id = ? and status = 1 and assessment_date= ?", patientID, orgID, assessment_date).Find(&record).Error
|
456
|
456
|
if err != nil {
|
457
|
457
|
if err == gorm.ErrRecordNotFound {
|
458
|
458
|
return nil, nil
|
|
@@ -464,9 +464,9 @@ func MobileGetTreatmentSummaryOne(orgID int64, patientID int64) (*models.Treatme
|
464
|
464
|
}
|
465
|
465
|
|
466
|
466
|
// 透析处方
|
467
|
|
-func MobileGetDialysisPrescribeByModeIdSix(orgID int64, patientID int64, mode_id int64) (*models.DialysisPrescription, error) {
|
|
467
|
+func MobileGetDialysisPrescribeByModeIdSix(orgID int64, patientID int64, mode_id int64, record_date int64) (*models.DialysisPrescription, error) {
|
468
|
468
|
var record models.DialysisPrescription
|
469
|
|
- err := readDb.Model(&models.DialysisPrescription{}).Where("patient_id = ? and user_org_id = ? and status = 1 AND mode_id = ?", patientID, orgID, mode_id).Last(&record).Error
|
|
469
|
+ err := readDb.Model(&models.DialysisPrescription{}).Where("patient_id = ? and user_org_id = ? and status = 1 AND mode_id = ? and record_date = ?", patientID, orgID, mode_id, record_date).Find(&record).Error
|
470
|
470
|
if err != nil {
|
471
|
471
|
if err == gorm.ErrRecordNotFound {
|
472
|
472
|
return nil, nil
|