QAInsertion_1
1.Insert query types in MST_QueryType table
2.Insert diagnosisname in MST_QueryDiagnosis table Eg:insert into MST_QueryDiagnosis(querydiagnosisname) values('Aspiration Pneumonia POA')
3.Insert alert name in MST_QueryAlert table with querytypeid,diagnosisid and childcount.It will generate QueryAlertId. Childcount should be same as conditioncount in MST_QueryAlertLogicGroup table . Childcount depends on the threshold logic(and,or). Eg:nsert into MST_QueryAlert(Queryalertname,querytypeid,querydiagnosisid,ChildCount) values('Pulmonary Collapse Clarification',8,44,1)
4.Insert Threshold logic groups in MST_QueryAlertLogicGroup. First insert parent entry record with parentid 0,conditioncount(based on threshold logic). Then insert child records with parentid as groupid of parent record and childcount. If required insert sub child records.For leaf nodes childcount is 0. Eg:If threshold logic is A and B and C,first insert parent node with childcount 3,then insert 3 child enries with childcount 0. If threshold logic is A or B,first insert parent entry with childcount 1,then insert A or B as single entry with childcount 0. If threshold logic is (A and B) or C,first insert parent entry with childcount 1,then two childs first one as A and B with childcount 2,parentid is parent entry groupid,then insert two sub childs with childcount 0 ,parenid is (A and B) groupid,second one as C with childcount 0 and parentid is main parent entry groupid.
5.Insert vitals in MST_QueryAlertCriteriaElement with vitalname in criteriaelementname column and source_uniqueid from MST_VitalSignDictionary table corresponding vital uniqueid and source_table as MST_VitalSignDictionary.
Eg:If Heart Rate uniqueid is 8 in MST_VitalSignDictionary,then we have to make an entry in MST_QueryAlertCriteriaElement Criteriaelementtype as Vitalsign,Criteriaelementname as Heart Rate,Source_Uniqueid is 8,Source_table is MST_VitalSignDictionary.
Eg: insert into MST_QueryAlertCriteriaElement (criteriaelementtype,criteriaelementname,source_uniqueid,source_table) values('Vitalsign','Heart Rate',8,'MST_VitalSignDictionary')
Insert labs in MST_QueryAlertCriteriaElement with criteriaelementname as labname and source_uniqueid from MST_LabDictionary table corresponding lab uniqueid and source_table as MST_LabDictionary.
Insert Target ICDs,Threshold ICDs,Suggestive ICDs,Threshold medical concepts,Suggestive nedical concepts,Threshold medications,Suggestive medications groupnames in criteriaelement column for each alert with corresponding source_table and source_uniqueid, Source_uniqueid should match with source_table uniqueid.source_uniqueid should not be duplicate.Manually insert the source_uniqueid with max+1 number from corresponding tables.Criteriaelementname should me meaningful related to that alert.
Eg: insert into MST_QueryAlertCriteriaElement(criteriaelementtype,criteriaelementname,source_uniqueid,source_table) values('ICDCode','GI Vascular Insufficiency Target ICD Codes',116,'MST_QueryAlert_ICDClassification') insert into MST_QueryAlertCriteriaElement(criteriaelementtype,criteriaelementname,source_uniqueid,source_table) values('ICDCode','Major Depression Threshold ICD Codes',92,'MST_QueryAlert_ICDClassification')
insert into MST_QueryAlertCriteriaElement(criteriaelementtype,criteriaelementname,source_uniqueid,source_table) values('ICDCode','GI Vascular Insufficiency Suggestive ICD Codes',117,'MST_QueryAlert_ICDClassification')
insert into MST_QueryAlert_DrugClassification(qaclassname,drugbrandname,route,uniqueid,priority) select distinct 'GI Vascular Insufficiency Suggestive Medications',medicationtype,route,43,tier from MedmineMaster.dbo.SuggestiveMedications where alertid=49 and status=0
insert into MST_QueryAlert_MedicalConceptClassification(qaclassname,MedicalConceptname,uniqueid,priority) select distinct 'GI Vascular Insufficiency Threshold Medical Concepts',keyword,83,tier from MedmineMaster.dbo.QueryWords where alertid=49 and status=0
insert into MST_QueryAlert_MedicalConceptClassification(qaclassname,MedicalConceptname,uniqueid,priority) select distinct 'GI Vascular Insufficiency Suggestive Medical Concepts',keyword,84,tier from MedmineMaster.dbo.SuggestiveKeywords where alertid=49 and status=0
6.Insert records into MST_QueryAlert_ICDClassification table from old query alert tables with alertid.QAClassname should be meaningful name.UniqueId should be unique for each group in alert.This uniqueid should match with Source_UniqueId in MST_QueryAlertCriteriaElement. Insert records same as above in MST_QueryAlert_MedicalConceptClassification, MST_QueryAlert_DrugClassification tables.
Eg:insert into MST_QueryAlert_ICDClassification(qaclassname,icdcode,uniqueid,priority) select distinct 'Severe malnutrition Target ICD Codes',icdcode,100,1 from MedmineMaster.dbo.TargetICDS where alertid=67 and status=0
--insert into MST_QueryAlert_ICDClassification(qaclassname,icdcode,uniqueid,priority) select distinct 'Major Depression Threshold ICD Codes',icdcode,92,tier from MedmineMaster.dbo.QueryICD where alertid=65 and status=0
--insert into MST_QueryAlert_ICDClassification(qaclassname,icdcode,uniqueid,priority) select distinct 'Severe malnutrition Suggestive ICD Codes',icdcode,101,tier from MedmineMaster.dbo.SuggestiveQueryICD where alertid=67 and status=0
7.Insert every record in MST_QueryAlertCriteriaElementMapping which you have inserted in MST_QueryAlertCriteriaElement with corresponding alertid and criteriaelementid.Groupid is 0 for Target,suggestives.Threshold groupid is same as GroupId in MST_QueryAlertLogicGroup. Conditiontype is null for icd,keyword,medications.>,<,>=,<=,between for labs and vitals.Minvalue is the condition value which is given in excel. Minvalue is null for icd, keyword, medications. Conditionspecificity is compare, decrease, increase.. for labs and vitals,it is null for icd, keyword, medications. QueryCriteriaType is Target,Threshold,Suggestive. Priority is tier value given in excels. Eg:--insert into MST_QueryAlertCriteriaElementMapping(queryalertid,criteriaelementid,conditiontype,groupid,[minvalue],conditionspecificity,priority,querycriteriatype) values(46,107,'<',171,10,'compare',1,'Threshold')
--insert into MST_QueryAlertCriteriaElementMapping(queryalertid,criteriaelementid,conditiontype,groupid,[minvalue],conditionspecificity,priority,querycriteriatype) values(47,13,'>=',0,20,'compare',1,'Suggestive')
--insert into MST_QueryAlertCriteriaElementMapping(queryalertid,criteriaelementid,conditiontype,groupid,[minvalue],conditionspecificity,priority,querycriteriatype) values(47,301,null,0,null,null,null,'Target')
--insert into MST_QueryAlertCriteriaElementMapping(queryalertid,criteriaelementid,conditiontype,groupid,[minvalue],conditionspecificity,priority,querycriteriatype) values(47,305,null,0,null,null,null,'Suggestive')
--insert into MST_QueryAlertCriteriaElementMapping(queryalertid,criteriaelementid,conditiontype,groupid,[minvalue],conditionspecificity,priority,querycriteriatype) values(47,303,null,173,null,null,null,'Threshold')
New Query Alerts insertion tables:¶
select * from MST_QueryAlert
select * from MST_QueryType
select * from MST_QueryDiagnosis
select * from MST_QueryAlertLogicGroup
select * from MST_QueryAlertCriteriaElement
select * from MST_QueryAlert_DrugClassification
select * from MST_QueryAlert_MedicalConceptClassification
select * from MST_QueryAlert_ICDClassification
select * from MST_QueryAlertCriteriaElementMapping
Alkalosis entries:¶
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 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 | |