Browse Source

LIS申请

bjmzak
DESKTOP-G961P6V\Zhh 2 years ago
parent
commit
a29b06e1c8
  1. 16
      src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs
  2. 6
      src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs
  3. 2
      test/Shentun.Peis.Application.Tests/PrintReportAppServiceTest.cs

16
src/Shentun.Peis.Application/PrintReports/PrintReportAppService.cs

@ -172,23 +172,21 @@ namespace Shentun.Peis.PrintReports
join patientRegister in await _patientRegisterRepository.GetQueryableAsync() join patientRegister in await _patientRegisterRepository.GetQueryableAsync()
on patient.Id equals patientRegister.PatientId on patient.Id equals patientRegister.PatientId
join sex in await _sexRegisterRepository.GetQueryableAsync() on patientRegister.SexId equals sex.Id join sex in await _sexRegisterRepository.GetQueryableAsync() on patientRegister.SexId equals sex.Id
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on patientRegister.Id equals registerCheckAsbitem.PatientRegisterId into bb
from registerCheckAsbitemHaveEmpty in bb.DefaultIfEmpty()
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitemHaveEmpty.AsbitemId equals asbitem.Id into ff
from asbitemHaveEmpty in ff.DefaultIfEmpty()
join lisRequest in await _lisRequestRepository.GetQueryableAsync() on registerCheckAsbitemHaveEmpty.LisRequestId equals lisRequest.Id
join registerCheckAsbitem in await _registerCheckAsbitemRepository.GetQueryableAsync() on patientRegister.Id equals registerCheckAsbitem.PatientRegisterId
join asbitem in await _asbitemRepository.GetQueryableAsync() on registerCheckAsbitem.AsbitemId equals asbitem.Id
join lisRequest in await _lisRequestRepository.GetQueryableAsync() on registerCheckAsbitem.LisRequestId equals lisRequest.Id
join sampleContainer in await _sampleContainerRepository.GetQueryableAsync() on lisRequest.SampleContainerId equals sampleContainer.Id into dd join sampleContainer in await _sampleContainerRepository.GetQueryableAsync() on lisRequest.SampleContainerId equals sampleContainer.Id into dd
from sampleContainerHaveEmpty in dd.DefaultIfEmpty() from sampleContainerHaveEmpty in dd.DefaultIfEmpty()
join sampleType in await _sampleTypeRepository.GetQueryableAsync() on lisRequest.SampleTypeId equals sampleType.Id into ee join sampleType in await _sampleTypeRepository.GetQueryableAsync() on lisRequest.SampleTypeId equals sampleType.Id into ee
from sampleTypeHaveEmpty in ee.DefaultIfEmpty() from sampleTypeHaveEmpty in ee.DefaultIfEmpty()
where (patientRegister.Id == input.PatientRegisterId && registerCheckAsbitemHaveEmpty.LisRequestId != null)
where (patientRegister.Id == input.PatientRegisterId && registerCheckAsbitem.LisRequestId != null)
select new select new
{ {
patient, patient,
patientRegister, patientRegister,
sex, sex,
registerCheckAsbitemHaveEmpty,
asbitemHaveEmpty,
registerCheckAsbitem,
asbitem,
lisRequest, lisRequest,
sampleContainerHaveEmpty, sampleContainerHaveEmpty,
sampleTypeHaveEmpty sampleTypeHaveEmpty
@ -209,7 +207,7 @@ namespace Shentun.Peis.PrintReports
LisRequestId = o.lisRequest.Id, LisRequestId = o.lisRequest.Id,
PatientNo = o.patient.PatientNo, PatientNo = o.patient.PatientNo,
Age = o.patientRegister.Age, Age = o.patientRegister.Age,
AsbitemNames = string.IsNullOrEmpty(o.asbitemHaveEmpty.ShortName) ? o.asbitemHaveEmpty.DisplayName : o.asbitemHaveEmpty.ShortName,
AsbitemNames = string.IsNullOrEmpty(o.asbitem.ShortName) ? o.asbitem.DisplayName : o.asbitem.ShortName,
LisRequestNo = o.lisRequest.LisRequestNo, LisRequestNo = o.lisRequest.LisRequestNo,
PatientName = o.patientRegister.PatientName, PatientName = o.patientRegister.PatientName,
PatientRegisterNo = o.patientRegister.PatientRegisterNo, PatientRegisterNo = o.patientRegister.PatientRegisterNo,

6
src/Shentun.Peis.Domain/LisRequests/LisRequestManager.cs

@ -4,6 +4,7 @@ using Microsoft.Extensions.Configuration;
using Shentun.Peis.Enums; using Shentun.Peis.Enums;
using Shentun.Peis.Models; using Shentun.Peis.Models;
using Shentun.Peis.PlugIns; using Shentun.Peis.PlugIns;
using Shentun.Peis.PrintReports;
using Shentun.Peis.SysParmValues; using Shentun.Peis.SysParmValues;
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
@ -101,7 +102,8 @@ namespace Shentun.Peis.LisRequests
SetLisRequest(patientRegisterFirst, registerCheckAsbitems, sampleGroups, _sampleGroupDetail SetLisRequest(patientRegisterFirst, registerCheckAsbitems, sampleGroups, _sampleGroupDetail
, out var updateRegisterCheckAsbitems, out var createLisRequests); , out var updateRegisterCheckAsbitems, out var createLisRequests);
await _lisRequestRepository.InsertManyAsync(createLisRequests, true);
await _registerCheckAsbitemRepository.UpdateManyAsync(updateRegisterCheckAsbitems, true);
return createLisRequests; return createLisRequests;
} }
@ -257,6 +259,8 @@ namespace Shentun.Peis.LisRequests
SetLisRequest(patientRegisterFirst, registerCheckAsbitemeList, sampleGroups, _sampleGroupDetail SetLisRequest(patientRegisterFirst, registerCheckAsbitemeList, sampleGroups, _sampleGroupDetail
, out var updateRegisterCheckAsbitems, out var createLisRequests); , out var updateRegisterCheckAsbitems, out var createLisRequests);
await _lisRequestRepository.InsertManyAsync(createLisRequests, true);
await _registerCheckAsbitemRepository.UpdateManyAsync(updateRegisterCheckAsbitems, true);
//if (registerCheckAsbitemeList.Any()) //if (registerCheckAsbitemeList.Any())
//{ //{

2
test/Shentun.Peis.Application.Tests/PrintReportAppServiceTest.cs

@ -34,7 +34,7 @@ namespace Shentun.Peis
using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true)) using (var unitOfWork = _unitOfWorkManager.Begin(isTransactional: true))
{ {
var items = await _appService.GetLisRequestReportByPatientRegisterIdAsync(new PatientRegisterIdInputDto() var items = await _appService.GetLisRequestReportByPatientRegisterIdAsync(new PatientRegisterIdInputDto()
{ PatientRegisterId = new Guid("3a121793-cb40-49a6-17ab-5ba8ae323385") });
{ PatientRegisterId = new Guid("3a123c55-06de-4988-691c-448b5af468ff") });
_output.WriteLine(items.Count().ToString()); _output.WriteLine(items.Count().ToString());
foreach (var item in items) foreach (var item in items)
{ {

Loading…
Cancel
Save