maintenance: title: DOC_Tobacco_Assessment_Selections ;; mlmname: DOC_Tobacco_Assessment_Selections ;; arden: version 5.5;; version: 2.50;; institution: St.Clair Hospital;; author: Shivprasad Jadhav;; specialist: ;; date: 2015-05-10;; validation: testing;; library: purpose: On Adult patient profile Structure note, if the first list item is selected ‘recognizing danger situations’ then developing coping skills and provided basic information about quitting should also get selected. This should only occur when the location is of ‘PSYE’ and PSYW’.;; explanation: Select the Check boxex Change history --------------------------------- 2015-10-06 GOS Created CSR#33406 ;; keywords: ;; knowledge: type: data-driven;; data: standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}}; include standard_libs; using "ObjectsPlusXA.SCM.Forms"; using namespace "ObjectsPlusXA.SunriseClinicalManager.Forms"; // Recieve arguments from the structured note (thisDocumentCommunication) := argument; // Extract interesting parts of the object model (thisStructuredNoteDoc) := thisDocumentCommunication.DocumentConfigurationObj; (thisParameters) := thisStructuredNoteDoc.ParametersList; (thisObservations) := thisStructuredNoteDoc.ChartedObservationsList; // 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]; // Get the client and visit GUIDs clientGuid := thisDocumentCommunication.ClientGUID; visitGuid := thisDocumentCommunication.ClientVisitGUID; chartGuid := thisDocumentCommunication.ChartGUID; // For Adult Patient Profile ----------------------------------------------------------------------------------------------------- this_parametername := Last of (thisParameters where thisParameters.Name = "SCHCK Tobacco Use Practical Counseling/Education"); theObservation := Last of (thisobservations where thisobservations.ParameterGUID = this_parametername.ParameterGUID); /*a:=theObservation.ValueObj.ListItemsList.Records__ ; b:= Last of ( theObservation Where theObservation.ValueObj.ListItemsList.IsSelected= True ); d:= b.ValueObj.Records__ ; c:=b.ValueObj.ListItemsList.Value ; */ If true in (theObservation.ValueObj.ListItemsList.IsSelected where theObservation.ValueObj.ListItemsList.Value = "recognizing danger situations" ) then chronic := "recognizing danger situations"; endif; (LocationLevelCode) := read last { "select Top 1 case when cc.typecode = {{{SINGLE-QUOTE}}}unit{{{SINGLE-QUOTE}}} then cc.levelcode when b.typecode={{{SINGLE-QUOTE}}}unit{{{SINGLE-QUOTE}}} then b.levelcode when a.typecode={{{SINGLE-QUOTE}}}unit{{{SINGLE-QUOTE}}} then a.levelcode " || " when cv3l.typecode={{{SINGLE-QUOTE}}}unit{{{SINGLE-QUOTE}}} then cv3l.levelcode else null end as Unit From CV3ClientVisit CV With (nolock) " || " Inner Join Cv3Location L With (nolock) On L.Guid=CV.CurrentLocationGUID AND CV.Active=1 AND CV.VisitStatus={{{SINGLE-QUOTE}}}ADM{{{SINGLE-QUOTE}}} " || " Left Join Cv3ClientVisitLocation CVL With (nolock) ON CVL.ClientVisitGUID=CV.GUID Left Join CV3Location CV3L On CV3L.GUID=CVL.LocationGUID " || " Left Join CV3Location a With (nolock) on CV3L.parentguid= a.guid Left Join CV3Location b With (nolock) on a.parentguid = b.guid " || " left join cv3location cc With (nolock) on b.parentguid = cc.guid " || " WHERE CVL.Status={{{SINGLE-QUOTE}}}CUR{{{SINGLE-QUOTE}}} and CV.GUID = " || visitGuid || " " }; If chronic = "recognizing danger situations" And LocationLevelCode In ("PSYE","PSYW") Then MLM_DIPA := MLM {{{SINGLE-QUOTE}}}UTIL_OBJECT_Customize_DIPA_MLM{{{SINGLE-QUOTE}}}; prm_Comf_mes := First of (thisParameters where thisParameters.Name = "SCHCK Tobacco Use Practical Counseling/Education"); Var1 := "recognizing danger situations" ,"developing coping skills" ,"provided basic information about quitting"; //recognizing danger situations, developing coping skills, provided basic information about quitting, provided exit care packet based on readiness to learn, refuses counseling/education If true in (theObservation.ValueObj.ListItemsList.IsSelected where theObservation.ValueObj.ListItemsList.Value = "provided exit care packet based on readiness to learn" ) then Var1 := Var1 , "provided exit care packet based on readiness to learn"; endif; If true in (theObservation.ValueObj.ListItemsList.IsSelected where theObservation.ValueObj.ListItemsList.Value = "refuses counseling/education" ) then Var1 := Var1 , "refuses counseling/education"; endif; //To Clear the existing Charted Values========================================================================================= //Obs_Comf_Vi := CALL MLM_DIPA WITH thisDocumentCommunication,prm_Comf_mes, "" as string ; //Obs_Comf_Vi.ValueObj.SuggestedTextValue := vi_Sugg ; //thisDocumentCommunication.DocumentConfigurationObj.ChartedObservationsList := ( // thisDocumentCommunication.DocumentConfigurationObj.ChartedObservationsList,Obs_Comf_Vi ); //------------------------------------------------------------------- Obs_Comf_Vi := CALL MLM_DIPA WITH thisDocumentCommunication,prm_Comf_mes, Var1 as string ; //Obs_Comf_Vi.ValueObj.SuggestedTextValue := vi_Sugg ; thisDocumentCommunication.DocumentConfigurationObj.ChartedObservationsList := ( thisDocumentCommunication.DocumentConfigurationObj.ChartedObservationsList,Obs_Comf_Vi ); Endif; ;; evoke: ;; logic: conclude true; ;; action: return thisDocumentCommunication; ;; Urgency: 50;; end: