|
@@ -14,6 +14,7 @@ import com.ywt.mg.models.PrescriptionPushApiRequest.DoctorInfo;
|
|
|
import com.ywt.mg.models.PrescriptionPushApiRequest.DrugInfo;
|
|
|
import com.ywt.mg.models.PrescriptionPushApiRequest.PatientInfo;
|
|
|
import com.ywt.mg.models.PrescriptionPushApiRequest.PrescriptionPushData;
|
|
|
+import com.ywt.mg.models.enums.PrescriptionInfoSourceEnum;
|
|
|
import org.slf4j.Logger;
|
|
|
import org.slf4j.LoggerFactory;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
@@ -42,6 +43,10 @@ public class DrugController {
|
|
|
@Autowired
|
|
|
private DrugServiceGrpc.DrugServiceBlockingStub drugServiceBlockingStub;
|
|
|
|
|
|
+ private final int TaiheHospitalId = 12;
|
|
|
+ private final int BaiyunHospitalId = 41;
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* 查询药品订单列表
|
|
|
*/
|
|
@@ -81,6 +86,12 @@ public class DrugController {
|
|
|
DoctorInfo doctor = prescriptionPushData.getDoctor();
|
|
|
List<com.ywt.mg.models.PrescriptionPushApiRequest.PrescriptionInfo> prescriptions = prescriptionPushData.getPrescriptions();
|
|
|
int hospitalId = prescriptionPushData.getHospitalId();
|
|
|
+ int source = 0;
|
|
|
+ if (hospitalId == TaiheHospitalId) {
|
|
|
+ source = PrescriptionInfoSourceEnum.TaiHeHIS.getValue();
|
|
|
+ } else if (hospitalId == BaiyunHospitalId) {
|
|
|
+ source = PrescriptionInfoSourceEnum.BaiYunHIS.getValue();
|
|
|
+ }
|
|
|
List<PrescriptionInfo> prescriptionInfoList = new ArrayList<>();
|
|
|
for (com.ywt.mg.models.PrescriptionPushApiRequest.PrescriptionInfo prescription : prescriptions) {
|
|
|
PrescriptionInfo.Builder pInfoBuilder = PrescriptionInfo.newBuilder()
|
|
@@ -97,7 +108,7 @@ public class DrugController {
|
|
|
.setPrescriptionDate(prescription.getDetail().getPrescriptionTime())
|
|
|
.setHosptialId(hospitalId)
|
|
|
//表示his 来源
|
|
|
- .setSource(6);
|
|
|
+ .setSource(source);
|
|
|
|
|
|
for (DrugInfo drugInfo : prescription.getDrugs()) {
|
|
|
|
|
@@ -165,7 +176,7 @@ public class DrugController {
|
|
|
logger.error("DrugController#prescriptionPushApi#eventData:{},{}", eventData, e.getMessage(), e);
|
|
|
if (!Checker.isNone(e.getMessage())) {
|
|
|
return response.failedWithAppError("处理失败:" + e.getMessage());
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return response.failedWithAppError("处理失败:未知异常");
|
|
|
}
|
|
|
}
|