- Get the the list of active deficiencies by running the 02_open_deficiencies.sql.
- Def Assignment TAT = DeficiencyCreateDateTime - DocumentCreateDateTime
- Get the list of completed deficiencies by running the 03_completed_deficiencies.sql.
- Parse the ListData field's xml.
- If the DocId is not listed in the deficiencies table in the operational database and the DocType is valid:
- Def Assignment TAT = //Deficiency/CreateDateTime - Document.CreateDateTime
- Def Completed TAT = Event.StartDateTime - Document.CreateDateTime
- If the DocId is not listed in the deficiencies table in the operational database and the DocType is valid:
- Parse the ListData field's xml.
Created
October 18, 2011 18:47
-
-
Save ebot/1296297 to your computer and use it in GitHub Desktop.
How to gather data on open and closed deficiencies
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT DefId, DefTypeName, def.CreateDateTime AS DeficiencyCreateDateTime, | |
DefStatusName, d.DocId, DocTypeName, | |
d.CreateDateTime AS DocumentCreateDateTime, EnrolleeName AS Provider, | |
dept.MiscCfgDesc AS ProviderDepartment, role.MiscCfgDesc AS ProviderRole, | |
EncounterNo, EncntrClass | |
FROM Deficiencies AS def | |
INNER JOIN DeficiencyTypes AS deft ON def.DefType = deft.DefType | |
INNER JOIN DeficiencyStatus AS defs ON def.DefStatus = defs.DefStatus | |
-- Get Provider Data | |
INNER JOIN Users AS u ON def.RespPartyOwnerId = u.UserOwnerId | |
INNER JOIN Employees AS emp ON u.EmpOwnerId = emp.EmpOwnerId | |
INNER JOIN Enrollees AS enr ON emp.EnrolleeOwnerId = enr.EnrolleeOwnerId | |
INNER JOIN MiscConfig AS dept ON emp.EmpDeptMiscCfgId = dept.MiscCfgId AND emp.EmpDeptMiscCfgType = dept.MiscCfgType | |
INNER JOIN MiscConfig AS role ON u.RoleMiscCfgId = role.MiscCfgId AND u.RoleMiscCfgType = role.MiscCfgType | |
-- Get Document Data | |
INNER JOIN Documents AS d ON def.DocId = d.DocId | |
INNER JOIN DocTypes AS dt ON d.DocType = dt.DocType | |
-- Get Encounter Data | |
INNER JOIN DocsOwners AS do ON d.DOcId = do.DocId | |
INNER JOIN Encounters AS enc ON do.OwnerId = enc.EncntrOwnerId | |
WHERE DefTypeName = 'Signature' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT UserId, StartDateTime, CompleteDateTime, ListData, MedRecNo, EncounterNo | |
FROM Events AS e | |
INNER JOIN ActionDescs AS ad ON e.ActionId = ad.ActionId | |
WHERE ActionName IN ('Complete Signature Deficiency', 'Complete Deficiency') | |
AND StartDateTime >= '10/17/2011' | |
AND StartDateTime < '10/18/2011' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Deficiency DefId="FE7644CE-0AFD-11E0-A0B9-001517625D7B"> | |
<Status>A</Status> | |
<DefType DefTypeName="Signature" Id="-4">-4</DefType> | |
<RespPartyId>039CA9BBB63B7398</RespPartyId> | |
<PrevRespPartyId>0000000000000000</PrevRespPartyId> | |
<DocId>FE7644CD-0AFD-11E0-A0B9-001517625D7B</DocId> | |
<FolderId>1E5CB9DDBAF049A8</FolderId> | |
<DueDate>01 JAN 2011 00:00:00</DueDate> | |
<FolderOnHoldDate></FolderOnHoldDate> | |
<RespPartOnHoldDate></RespPartOnHoldDate> | |
<CreateUser>1A5C9E61ACC288E3</CreateUser> | |
<CreateDateTime>18 DEC 2010 23:24:00 GMT</CreateDateTime> | |
<ExtraInfo> | |
<Anno type="deficiency"> | |
<DefChainId>9</DefChainId> | |
<AutoPosition Mode="Bottom" Always="1" /> | |
<ChainAutoCreated>1</ChainAutoCreated> | |
</Anno> | |
</ExtraInfo> | |
<ObjectId>1</ObjectId> | |
<Active>1</Active> | |
<RespPartyType>E</RespPartyType> | |
<RespPartyConfig>-2</RespPartyConfig> | |
<History> | |
<Note DefId="FE7644CE-0AFD-11E0-A0B9-001517625D7B" SeqNo="1"> | |
<DefNotes></DefNotes> | |
<CreateDateTime>18 DEC 2010 23:24:00 GMT</CreateDateTime> | |
<CreateUser>395C91F46FA79442</CreateUser> | |
</Note> | |
</History> | |
<AgingType>0</AgingType> | |
<AgingBaseDate>17 DEC 2010 00:00:00</AgingBaseDate> | |
<AgingDelinqDays>15</AgingDelinqDays> | |
<DefPriority>1</DefPriority> | |
<PredecessorList></PredecessorList> | |
<SuccessorList></SuccessorList> | |
<TextLine>Signature ED Summary</TextLine> | |
</Deficiency> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment