QAInsertion

QueryAlert Data Insertion:

Step1:

You should identify the queryType of QueryAlert to this table MST_QueryType and if it is found then pickup QueryTypeId and if it is not found then you will need to insert an queryType of QueryAlert to MST_QueryType.

Step2:

You should identify the queryDiagnosis of QueryAlert to this table MST_QueryDiagnosis and if it is found then pickup QueryDiagnosisId and if it is not found then you will need to insert an QueryDiagnosisId of QueryAlert to this MST_QueryType.

Step3:

You should insert an QuertAlert to MST_QueryAlert based on you collected info using above Step1 and Step2. Here ChildCount describes a value which depends on CriteriaLogic of an QueryAlert.

Step4:

Before going to this step first you should study the CriteriaLogic of QueryAlert and find out the value of ConditionCount as well as how many child's to this QueryAlert and finally entire logic of QueryAlert insert into this Table MST_QueryAlertLogicGroup. By Default parentId of any QueryAlert should become Zero.

Step5:

You should provide complete Information about CriteriaLogic of QueryAlert to this table MST_QueryAlertCriteriaElement. Basically each and every QueryAlert should have types of criteriaLogic which are Target,Threshold and Suggestive. CriteriaElementType like ICDCode,DRGCode,MedicalConcepts,Labs,Drugs and Vitals are comes under above CriteriaLogic Types.

Step6:

In Step5 you should provide only CriteriaLogic of QueryAlert Information but not data.you need to provide CriteriaLogic data and appropriate tables to the following ways.

1.MST_QueryAlert_ICDClassification:

In this table we need to Insert TargetICD,ThresholdICD and SuggestiveICD codes from QueryAlert CriteriaLogic Section.As of now we are inserting data from MedmineMaster Database tables which are MedmineMaster.dbo.TargetICD,MedmineMaster.dbo.QueryICD and MedmineMaster.dbo.SuggestiveICD based on QueryAlertID.

2.MST_QueryAlert_DrugClassification:

In this table we need to Insert ThresholdMedication and SuggestiveMedication from QueryAlert CriteriaLogic Section.As of now we are inserting data from MedmineMaster Database tables which are MedmineMaster.dbo.QueryMedication and MedmineMaster.dbo.SuggestiveMedication based on QueryAlertID.

3.MST_QueryAlert_MedicalConceptClassification:

In this table we need to Insert ThresholdKeywords and SuggestiveKeywords from QueryAlert CriteriaLogic Section.As of now we are inserting data from MedmineMaster Database tables which are MedmineMaster.dbo.QueryWords and MedmineMaster.dbo.Suggestivekeywords based on QueryAlertID.

4.MST_VitalSignDictionary:

You don't need to provide the data to this table because of it is Standard table.

5.MST_LabDictionary:

You don't need to provide the data to this table because of it is Standard table.

Step7:

In this step you should know about most important and information table and it is linked to entire CriteriaLogic of QueryAlert which is MST_QueryAlertCriteriaElementMapping.you need to insert data to this based on GroupId and CriteriaLogicTypes which are Target,Threshold and Suggestive.

Step7 For Sample QueryAlert Insertion:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
select * from MST_QueryType where QueryTypeId=9
select * from MST_QueryDiagnosis where querydiagnosisname like '%Post Operative Pneumonia%'
--insert into MST_QueryDiagnosis(querydiagnosisname) values('Post Operative Pneumonia')

select * from MST_QueryAlert where QueryAlertName like '%Post Operative Pneumonia%'
--insert into MST_QueryAlert(Queryalertname,querytypeid,querydiagnosisid,ChildCount)values('Post Operative Pneumonia Clarification',9,67,1)

select * from MST_QueryAlertLogicGroup where GroupName like '%Post Operative Pneumonia%'
--ParentID Insertion
--insert into MST_QueryAlertLogicGroup (QueryAlertId,GroupName,ParentId,ConditionCount)values(61,'Post Operative Pneumonia Clarification Alert',0,1)
--Child to that ParentID Insertion 
--insert into MST_QueryAlertLogicGroup (QueryAlertId,GroupName,ParentId,ConditionCount)values(61,'Post Operative Pneumonia ICD',199,0)

select * from MST_QueryAlertCriteriaElement where CriteriaElementName like '%Post Operative Pneumonia%'
insert into MST_QueryAlertCriteriaElement(criteriaelementtype,criteriaelementname,source_uniqueid,source_table)
values('MedicalConcept','Post Operative Pneumonia Suggestive MedicalConcept',92,'MST_QueryAlert_MedicalConceptClassification')

--Target ICDS Insertions From MedmineMaster To HRCM
insert into MST_QueryAlert_ICDClassification(qaclassname,icdcode,uniqueid,priority)
select distinct 'Post Operative Pneumonia Target ICD Codes',icdcode,122,1 from MedmineMaster.dbo.TargetICDS where alertid=35 and status=0

--Threshold ICDS Insertions From MedmineMaster To HRCM******    POA Condition
insert into MST_QueryAlert_ICDClassification(qaclassname,icdcode,uniqueid,priority,POA)
select distinct 'Post Operative Pneumonia Threshold ICDCodes',icdcode,126,tier,'N' from MedmineMaster.dbo.QueryICD where alertid=43 and status=0

--Suggestive ICDS Insertions From MedmineMaster To HRCM
insert into MST_QueryAlert_ICDClassification(qaclassname,icdcode,uniqueid,priority)
select distinct 'Post Operative Pneumonia Suggestive ICDCodes',icdcode,127,tier from MedmineMaster.dbo.SuggestiveQueryICD where alertid=43 and status=0

select * from MST_QueryAlertCriteriaElement where CriteriaElementName like '%Post Operative Pneumonia%'
select * from MST_QueryAlert_DrugClassification where UniqueId=48

--Suggestive Medications Insertions From MedmineMaster To HRCM
insert into MST_QueryAlert_DrugClassification(qaclassname,drugbrandname,route,uniqueid,priority) --values('Pressure Ulcer POA Suggestive Medications','Dantrium',NULL,24,2)
select distinct 'Post Operative Pneumonia Suggestive Medications',medicationtype,route,48,tier from MedmineMaster.dbo.SuggestiveMedications where alertid=43 and status=0
select distinct 'Post Operative Pneumonia Threshold Medications',medicationtype,route,35,tier from MedmineMaster.dbo.QueryMedications where alertid=63 and status=0