maintenance: title: DOC_Pediatric_Humpty_Dumpty_AgeGender ;; mlmname: DOC_Pediatric_Humpty_Dumpty_AgeGender ;; arden: version 6.1;; version: 2.50;; institution: St.Clair Hospital;; author: Shivprasad Jadhav ;; specialist: Shivprasad Jadhav, Allscripts Corporation;; date: 2015-10-12;; validation: testing;; library: purpose: Autoselect [Age] and [Gender] of Patient on [2.Pediatric assessment/Intervention] flowsheet under Humpty-Dumpty observation set. ;; explanation: Change history 2015-01-10 GOS CSR 32399 : Create date. ;; keywords: ;; knowledge: type: data-driven;; data: // Receive arguments from the structured note (this_documentCommunication) := argument; /******************************************************************************/ // Create prototypes for the object types we{{{SINGLE-QUOTE}}}ll need to instantiate ObservationType := OBJECT [ObservationGUID, ClientDocumentGUID, ParameterGUID, DataType, ValueObj]; FreeTextValueType := OBJECT [Value]; ListValueType := OBJECT [ListGuid, ListItemsList, SuggestedTextValue]; ListValueListItemType := OBJECT [ListItemGUID, Value, IsSelected]; //Set Flowsheet DocumentCommunication object model variables via Called MLM (this_fs_doc) := this_documentCommunication.DocumentConfigurationObj; (this_parameters) := this_fs_doc.ParametersList; (this_currentObs) := this_documentCommunication.CurrentObservationObj; (this_cols) := this_fs_doc.ColumnsList; (this_curr_col) := this_fs_doc.CurrentColumn; (this_chartedObs) := this_curr_col.ChartedObservationsList; document_type := this_documentCommunication.DocumentType; event_type := this_documentCommunication.EventType; client_guid := this_documentCommunication.ClientGUID; visit_guid := this_documentCommunication.ClientVisitGUID; chart_guid := this_documentCommunication.ChartGUID; Age := Read First{"Select dbo.AgeCalculation22(cv.ClientGuid, Getdate(), {{{SINGLE-QUOTE}}}y{{{SINGLE-QUOTE}}}) " || " from cv3ClientVisit cv With (nolock) Join cv3Client c With (nolock) on c.guid=cv.ClientGUID And cv.guid = " || visit_guid ||" "} ; Gender := Read First{"Select c.GenderCode " || " from cv3ClientVisit cv With (nolock) Join cv3Client c With (nolock) on c.guid=cv.ClientGUID And cv.guid = " || visit_guid ||" "} ; If Age < 3 Then Age_Val := "Less than 3 years old"; Elseif Age >=3 and Age < 7 Then Age_Val := "3 to less than 7 years old"; Elseif Age >=7 and Age < 13 Then Age_Val := "7 to less than 13 years old"; Elseif (Age > 13) or (Age =13) Then Age_Val := "13 years and above"; Endif; If Gender ="Male" Then Gender_Val:= "Male"; Elseif Gender = "Female" Then Gender_Val:= "Female"; Endif; // for Age Selection Prm_Age := first of ( this_parameters where this_parameters.Name = "SCHCK_PAI_Age A"); //Prm_Focus := first of ( this_parameters where this_parameters.Name = "schck_pai_ High risk protocol" ); //"SCHCK_PAI_Cognitive Impairment D" "SCHCK_PAI_Environmental Factor E"); If exists Prm_Age Then this_currentObj2 := NEW ObservationType; this_currentObj2.ClientDocumentGUID := this_fs_doc.ClientDocumentGUID; this_currentObj2.ParameterGUID := Prm_Age.ParameterGUID; this_currentObj2.DataType := "ListValue"; this_currentObj2.ValueObj := NEW ListValueType; this_currentObj2.ValueObj.ListGUID := Prm_Age.ConfigurationObj.ListGUID; listItems := (); //abb := Prm_Age.ConfigurationObj.ListItemsList.Records__ ; for item IN Prm_Age.ConfigurationObj.ListItemsList do // Need to Pass the Value as Item for {{{SINGLE-QUOTE}}}LISTITEM{{{SINGLE-QUOTE}}} selectedItem := NEW ListValueListItemType; selectedItem.ListItemGUID := item.ListItemGUID; selectedItem.Value := item.Value; If Item.Value = Age_Val Then selectedItem.IsSelected := true; Else selectedItem.IsSelected := False; EndIf; listItems := (listItems, selectedItem); Enddo; this_currentObj2.ValueObj.ListItemsList := listItems; this_fs_doc.CurrentColumn.ChartedObservationsList := (this_fs_doc.CurrentColumn.ChartedObservationsList, this_currentObj2 ); EndIf; // for Gender Selection Prm_Gender := first of ( this_parameters where this_parameters.Name = "SCHCK_PAI_Gender B"); If exists Prm_Gender Then this_currentObj3 := NEW ObservationType; this_currentObj3.ClientDocumentGUID := this_fs_doc.ClientDocumentGUID; this_currentObj3.ParameterGUID := Prm_Gender.ParameterGUID; this_currentObj3.DataType := "ListValue"; this_currentObj3.ValueObj := NEW ListValueType; this_currentObj3.ValueObj.ListGUID := Prm_Gender.ConfigurationObj.ListGUID; listItems := (); for item IN Prm_Gender.ConfigurationObj.ListItemsList do // Need to Pass the Value as Item for {{{SINGLE-QUOTE}}}LISTITEM{{{SINGLE-QUOTE}}} selectedItem := NEW ListValueListItemType; selectedItem.ListItemGUID := item.ListItemGUID; selectedItem.Value := item.Value; If Item.Value = Gender_Val Then selectedItem.IsSelected := true; Else selectedItem.IsSelected := False; EndIf; listItems := (listItems, selectedItem); Enddo; this_currentObj3.ValueObj.ListItemsList := listItems; this_fs_doc.CurrentColumn.ChartedObservationsList := (this_fs_doc.CurrentColumn.ChartedObservationsList, this_currentObj3 ); EndIf; // To Set focus on 4rth observation //this_documentCommunication.FocusParameterGUID := Prm_Focus.ParameterGUID; ;; evoke: ;; logic: conclude true; ;; action: return this_documentCommunication; ;; Urgency: 50;; end: