Project

General

Profile

Actions

Feature #1607

closed

Feature #1606: Integration MDL Visit to requisition

Update DMDL service to import visits

Added by Artem Bakhmat almost 6 years ago. Updated over 5 years ago.

Status:
Closed
Priority:
Normal
Assignee:
Alice Gor
Category:
GUI Backend
Target version:
-
Start date:
02/12/2020
Due date:
% Done:

100%


Files

MDlConnectServiceTestingSteps.txt (2.58 KB) MDlConnectServiceTestingSteps.txt Artem Bakhmat, 03/13/2020 07:24 AM

Subtasks 3 (0 open3 closed)

Feature #1627: Create queue to fetch orders with "AdminVerified" status - electronic and normal reqsClosedAlice Gor02/12/2020

Actions
Feature #1644: Process queue to create order visitsClosedAlice Gor02/13/2020

Actions
Feature #1678: Upload images to file storageClosedAlice Gor02/19/2020

Actions
Actions #1

Updated by Artem Bakhmat almost 6 years ago

  • Assignee set to Olga Bakhmat
Actions #2

Updated by Olga Bakhmat almost 6 years ago

As per discussion with Anatoly we decide to use existing BillinProcessApp service (that is running each 2 minutes and process "AdminVerify" orders) and enhance it with "MobileAppVisits" functionality.
The brief description of functionality is next:
1. First we get all orders that have AdminVerifyStatus (in here we fetch both genaral and electronic orders)
2. Then for each order we try to find existing visit if below conditions meet:
2.1. If client is setup for mobile (TBD: not sure how we can check it, per Anatoly this logic is already exists)
2.2. If order's Pysician Id and DateOfService (tblreqmdls.GuidMdlNumber and tblreqspecimens.DateCollected) are matched with visits PhysicianId and DateCreated (tblpatientVisits.PhysicianId and DateCreate columns)
2.3. If above condition are met then try to match patients: check if first/last names and date of birth are matched

3. If all conditions from #2 is met for specific order then we do next:
3.1. Assign order with visits - create record in the tblordervisits table
3.2. Upload visit image to file storage in order we can use them in the reporting flow. File storage path is set in the settings table tblglobals2, see related record below:
select * from tblglobals2 where Txt_FieldName = 'VisitImagesPath';
3.3. Update tblattachments - see screen http://prntscr.com/rdq25l
3.4. Update tblvisitimage record Path column with value of images upload relative path - see screen http://prntscr.com/rdq440

Actions #3

Updated by Sara Narayanamoorthy almost 6 years ago

please refer the Issue # 1196 for the updated business requirement

Actions #4

Updated by Artem Bakhmat almost 6 years ago

  • Status changed from New issue to Needs Testing
Actions #5

Updated by Artem Bakhmat almost 6 years ago

Query to fetch data:
SELECT
trm.Guid_MDLNumber, trm.Guid_ClientID, trm.Guid_PhysicianID, trbi.Guid_ReqBillingInfoID,trm.DateTime_AdminStatus,trm.UID_AdminStatus , s.Date_Collected AS DateOfService,
s.Specimen_Num,trm.Guid_PatientID, trm.Guid_Patient_VersionID, tpt.txt_LastName, tpt.txt_FirstName, tpt.txt_MI,tpt.SSN,tpt.Date_Of_Birth
FROM tblreqmdls trm
INNER JOIN tblreqbillinginfo trbi ON trm.Guid_MDLNumber = trbi.Guid_MDLNumber
AND (trbi.Txt_BillingServiceProc IN ('Pending', 'Fail 1', 'Fail 2') OR ISNULL) AND trbi.Billing_Status <> '4'
INNER JOIN tblpatients tpt ON trm.Guid_PatientId = tpt.Guid_PatientId AND trm.Guid_Patient_VersionID = tpt.Guid_Patient_VersionID
INNER JOIN tblreqspecimens s ON s.Guid_MDLNumber = trm.Guid_MDLNumber
AND s.Specimen_Num = (SELECT Specimen_Num FROM tblreqspecimens rs WHERE rs.Guid_MDLNumber = trm.Guid_MDLNumber AND ISNULL ORDER BY rs.Specimen_Num LIMIT 1)
WHERE trm.Admin_Status = '2'

Actions #6

Updated by Artem Bakhmat almost 6 years ago

Setup DB Data :
1) tblpatients (id = 2026) => tbltransitionpatients (11)
update tbltransitionpatients
set FirstName = 'CHERYL', LastName = 'RIVERA', DateOfBirth = '1982-01-07'
where id = 11

2. Setup order: http://prntscr.com/rdpejz

Query to fetch queues:
1. Admin verified orders
SELECT
trm.Guid_MDLNumber, trm.Guid_ClientID, trm.Guid_PhysicianID, trbi.Guid_ReqBillingInfoID,trm.DateTime_AdminStatus,trm.UID_AdminStatus , s.Date_Collected AS DateOfService,
s.Specimen_Num,trm.Guid_PatientID, trm.Guid_Patient_VersionID, tpt.txt_LastName, tpt.txt_FirstName, tpt.txt_MI,tpt.SSN,tpt.Date_Of_Birth
FROM tblreqmdls trm
INNER JOIN tblreqbillinginfo trbi ON trm.Guid_MDLNumber = trbi.Guid_MDLNumber
AND (trbi.Txt_BillingServiceProc IN ('Pending', 'Fail 1', 'Fail 2')) AND trbi.Billing_Status <> '4'
INNER JOIN tblpatients tpt ON trm.Guid_PatientId = tpt.Guid_PatientId AND trm.Guid_Patient_VersionID = tpt.Guid_Patient_VersionID
INNER JOIN tblreqspecimens s ON s.Guid_MDLNumber = trm.Guid_MDLNumber
AND s.Specimen_Num = (SELECT Specimen_Num FROM tblreqspecimens rs WHERE rs.Guid_MDLNumber = trm.Guid_MDLNumber ORDER BY rs.Specimen_Num LIMIT 1)
WHERE trm.Admin_Status = '2'
and trm.Guid_ClientID =10560 and trm.Guid_PhysicianID = 60876

2. Electronic orders
SELECT DISTINCT thio.Guid_HL7InORCPIDID, thio.Guid_MdlNumber, trbi.Guid_ReqBillingInfoID, trm.Guid_ClientID, trm.Guid_PatientID, trm.Guid_Patient_VersionID
, trbi.Date_Created, trbi.UID_Created, trbi.UID_Created, trm.Guid_PhysicianID, s.Specimen_Num
, IF, IF, s.Date_Created, s.DateTime_LabelsPrinted),s.Date_Collected) AS DateOfService
, COUNT AS Payer_Count
FROM tblreqbillinginfo trbi USE INDEX
INNER JOIN tblhl7inorcpid thio ON trbi.Guid_MDLNumber = thio.Guid_MDLNumber
INNER JOIN tblreqmdls trm ON trbi.Guid_MDLNumber = trm.Guid_MDLNumber
INNER JOIN tblreqspecimens s ON s.Guid_MDLNumber = trm.Guid_MDLNumber
AND s.Specimen_Num = (SELECT Specimen_Num FROM tblreqspecimens rs WHERE rs.Guid_MDLNumber = trm.Guid_MDLNumber AND ISNULL ORDER BY rs.Specimen_Num LIMIT 1)
LEFT OUTER JOIN tblhl7inorcin1 thin1 ON thin1.Guid_HL7InORCPID = thio.Guid_HL7InORCPIDID
LEFT OUTER JOIN tblhl7insurances thin ON thin1.Guid_HL7InsuranceID = thin.Guid_HL7InsuranceID
WHERE TRUE
AND trbi.Billing_Status IN
AND OR ISNULL)
GROUP BY thio.Guid_HL7InORCPIDID;

3. Patient visits
select v.Id as VisitId, v.ClientId, v.PhysicianId, v.DateExam as VisitDate, p.Id as PatientId, p.FirstName, p.LastName, p.DateOfBirth, p.Gender
from tblpatientvisits v
LEFT OUTER JOIN tblordervisits o on v.Id = o.VisitId
INNER JOIN tbltransitionpatients p on v.transitionPatientid = p.id
where o.OrderId is NULL and v.PhysicianId = {physicianId} and v.ClientId = {clientId}
and v.DateExam > Date('{dateOfService}') AND v.DateExam < DATE_ADD(Date('{dateOfService}'), INTERVAL 1 DAY)

Actions #7

Updated by Alice Gor almost 6 years ago

  • Category set to GUI Backend
Actions #8

Updated by Artem Bakhmat almost 6 years ago

  • Assignee changed from Olga Bakhmat to Alice Gor
Actions #9

Updated by Artem Bakhmat almost 6 years ago

  • File MDlConnectServiceTestingSteps added
Actions #10

Updated by Artem Bakhmat almost 6 years ago

  • File deleted (MDlConnectServiceTestingSteps)
Actions #11

Updated by Artem Bakhmat almost 6 years ago

  • File MDlConnectServiceTestingSteps.txt added
Actions #12

Updated by Artem Bakhmat over 5 years ago

  • File deleted (MDlConnectServiceTestingSteps.txt)
Actions #14

Updated by Alice Gor over 5 years ago

  • Status changed from Needs Testing to In Progress

Electronic order is pending rest all checked

Actions #15

Updated by Alice Gor over 5 years ago

  • Status changed from In Progress to Closed

The feature is tested and verified in DEV

Actions

Also available in: Atom PDF