Browse Source

体检系统对接晶奇,超声报告

jeremy 8 tháng trước cách đây
mục cha
commit
044c0b4f3c

+ 62 - 4
src/VitalMixtureService/Factury/JingQiApiHelper.cs

@@ -333,15 +333,73 @@ namespace VitalService.Factury
             dic.Add("exchkdoctor", "");// 审核医生
             dic.Add("repdt", reportInfo.CreateTime.ToLocalTime().ToString("yyyy-MM-dd"));
             dic.Add("exdt", reportInfo.UpdateTime.ToLocalTime().ToString("yyyy-MM-dd"));
-
-
             // 检验医生
             dic.Add("chkdoctorbasesign", DownloadFileAsync(GetReportElementValue(reportVaules, "DigitalSignature")).Result);
+            // 审核医生
             dic.Add("exdoctorbasesign", DownloadFileAsync(GetReportElementValue(reportVaules, "ReportPhysician")).Result);
             dic.Add("diagnosis", GetReportElementValue(reportVaules, "PatientEcgDiagnosticResult"));
-            dic.Add("result", reportInfo.HealthDiagnosis == 2 ? "正常" : "异常");
+            dic.Add("result", reportInfo.HealthDiagnosis == 1 ? "正常" : "异常");
             var imageList = GetReportElementArray(reportVaules, "PatientECGImage");
-            dic.Add("pic1base64", DownloadFileAsync(imageList.FirstOrDefault()).Result);
+            if (imageList.Count >= 1)
+            {
+                dic.Add("pic1base64", DownloadFileAsync(imageList[0]).Result);
+            }
+            else
+            {
+                dic.Add("pic1base64", "");
+            }
+
+            return JsonConvert.SerializeObject(dic);
+        }
+
+        /// <summary>
+        /// 转换超声报告
+        /// </summary>
+        /// <param name="examInfo"></param>
+        /// <param name="registerInfo"></param>
+        /// <param name="url"></param>
+        /// <returns></returns>
+        public string GetUSReportPostContentAsync(RegisterPersonInfoDTO registerInfo, FacturyOrgModel facturyInfo, WingInterfaceLibrary.DTO.Report.ReportDTO reportInfo, out string url)
+        {
+            url = $"{_serverUrl}/api/ultinf";
+
+            var jingQiInfos = registerInfo.JingQiExamInfos;
+            var pyhId = GetValue(jingQiInfos, "pyhid");
+
+            var dic = new Dictionary<string, string>();
+            dic.Add("pyhid", pyhId);
+
+            var reportVaules = reportInfo.ReportDatasJson;
+
+            dic.Add("barcode", reportInfo.ReportCode);
+            dic.Add("chkdoctor", GetReportElementValue(reportVaules, "InspectionPhysician"));
+            dic.Add("exchkdoctor", GetReportElementValue(reportVaules, "ReportPhysician"));
+            dic.Add("repdt", reportInfo.CreateTime.ToLocalTime().ToString("yyyy-MM-dd"));
+            dic.Add("exdt", reportInfo.UpdateTime.ToLocalTime().ToString("yyyy-MM-dd"));
+            // 检验医生
+            dic.Add("chkdoctorbasesign", DownloadFileAsync(GetReportElementValue(reportVaules, "DigitalSignature")).Result);
+            // 审核医生
+            // dic.Add("exdoctorbasesign", DownloadFileAsync(GetReportElementValue(reportVaules, "ReportPhysician")).Result);
+            dic.Add("describe", GetReportElementValue(reportVaules, "ReportDescription"));
+            dic.Add("diagnosis", GetReportElementValue(reportVaules, "ReportSummary"));
+            dic.Add("result", reportInfo.HealthDiagnosis == 1 ? "正常" : "异常");
+            var imageList = GetReportElementArray(reportVaules, "ReportImages");
+            if (imageList.Count >= 1)
+            {
+                dic.Add("pic1base64", DownloadFileAsync(imageList[0]).Result);
+            }
+            else
+            {
+                dic.Add("pic1base64", "");
+            }
+            if (imageList.Count >= 2)
+            {
+                dic.Add("pic2base64", DownloadFileAsync(imageList[1]).Result);
+            }
+            else
+            {
+                dic.Add("pic2base64", "");
+            }
 
             return JsonConvert.SerializeObject(dic);
         }

+ 2 - 0
src/VitalMixtureService/FrontService/Service/BaseService.cs

@@ -76,6 +76,7 @@ namespace VitalService.Service
         private IVitalOrganizationDBService _vitalOrganizationDBService;
         private IVitalFacturyUserDBService _vitalFacturyUserDBService;
         private IVitalFacturyPostHistoryDBService _vitalFacturyPostHistoryDBService;
+        private IRecordsInfoDBService _recordsInfoDBService;
         private PigeonUpload _pigeonUpload;
         private List<string> _appsettingCrowdLabels = new List<string>();
         private JingQiApiHelper _jingQiApiHelper;
@@ -136,6 +137,7 @@ namespace VitalService.Service
             _vitalFacturyPostHistoryDBService = GetProxy<IVitalFacturyPostHistoryDBService>();
             _prescriptionDBService = GetProxy<IVitalPrescriptionDBService>();
             _wingReportDBService = GetProxy<IReportDBService>();
+            _recordsInfoDBService = GetProxy<IRecordsInfoDBService>();
             AnalyzeStrategy.StorageHandler = UploadData;
             StartApi();
             LoadResourceInfos();

+ 3 - 3
src/VitalMixtureService/FrontService/Service/FacturyPostHistoryService.cs

@@ -207,8 +207,8 @@ namespace VitalService.Service
                     }
                     else if (reportInfo.ReportType == ReportTypeEnum.RemoteDiagnosis)
                     {
-                        var recordInfo = await _vitalElectrocardiogramDBService.GetExamElectrocardiogramDBAsync(reportInfo.RecordCode);
-                        physicalExamNumber = recordInfo?.PhysicalExamNumber;
+                        var recordInfo = await _recordsInfoDBService.FindRecordInfoByCodeAsync(reportInfo.RecordCode);
+                        physicalExamNumber = recordInfo?.DevicePatientID;
                     }
                     if (!string.IsNullOrWhiteSpace(physicalExamNumber))
                     {
@@ -226,7 +226,7 @@ namespace VitalService.Service
                             }
                             else if (reportInfo.ReportType == ReportTypeEnum.RemoteDiagnosis)
                             {
-                                rpcContent = _jingQiApiHelper.GetEcgReportPostContentAsync(registerInfo, facturyInfo, reportInfo, out xyUrl);
+                                rpcContent = _jingQiApiHelper.GetUSReportPostContentAsync(registerInfo, facturyInfo, reportInfo, out xyUrl);
                             }
                             if (!string.IsNullOrWhiteSpace(rpcContent))
                             {