113 lines
5.3 KiB
Plaintext
113 lines
5.3 KiB
Plaintext
maintenance:
|
||
|
||
title: DOC_FUNC_DISCHARGE_SUMMARY ;;
|
||
mlmname: DOC_FUNC_DISCHARGE_SUMMARY;;
|
||
arden: version 2.5;;
|
||
version: 0.00;;
|
||
institution: St. Clair Hospital;;
|
||
author: Shawn Head x7468;;
|
||
specialist: Shawn Head x7468;;
|
||
date: 2015-05-01;;
|
||
validation: testing;;
|
||
|
||
library:
|
||
purpose: Create a Discharge Summary report request for completed electronic Discharge summaries.
|
||
;;
|
||
explanation: This MLM will check to see if the Discharge Order Reconciliation is completed BEFORE allowing the patient discharge instructions, CCDA, and Discharge Summary are printed/created.
|
||
If Discharged Order Reconciliation is incomplete when the user clicks the "Print and send with patient" observation on the Discharge Instructions structured note they will get a
|
||
prompt letting them know you cannot print the discharge instructions until order reconciliation is completed.
|
||
History
|
||
5-1-2015 - STH CSR#: 32070 (DEV) - Created MLM - Loaded to PROD 6-2-2015
|
||
10.26.2015 STH Support case 1917862 - issue with clinic visits requing order rec completion
|
||
;;
|
||
keywords:
|
||
;;
|
||
citations:
|
||
;;
|
||
knowledge:
|
||
type: data-driven;;
|
||
data:
|
||
|
||
standard_libs := mlm {{{SINGLE-QUOTE}}}std_include_libs{{{SINGLE-QUOTE}}};
|
||
include standard_libs;
|
||
|
||
|
||
//void := CALL Print_DC_Summary with (clientguid,chartguid,visitguid,"Day of Discharge%");
|
||
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];
|
||
DateValueType := 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;
|
||
userGuid := thisDocumentCommunication.UserGUID;
|
||
|
||
(VisitType) := read {"select top 1 typecode from cv3clientvisit with (nolock) "
|
||
|| " where clientguid = " || sql(clientGuid)
|
||
|| " and chartguid = " || sql(chartGuid)
|
||
|| " and guid = " || sql(visitGuid)};
|
||
|
||
|
||
theParameter := first of (thisparameters where thisparameters.Name = "CXD Transition Care Print");
|
||
theObservation:= first of (thisobservations where thisobservations.ParameterGUID = theParameter.ParameterGUID);
|
||
|
||
dc_orderrec_GUID := read last {"select guid from CV3OrderReconcile with (nolock) "
|
||
|| " where clientguid = " || sql(ClientGuid)
|
||
|| " and chartguid = " || sql(ChartGuid)
|
||
|| " and ClientVisitGUID = " || sql(VisitGuid)
|
||
|| " and reconciletypecode = {{{SINGLE-QUOTE}}}discharge{{{SINGLE-QUOTE}}} "
|
||
|| " and ReconcileStatusType = 2 "};
|
||
|
||
if (((dc_orderrec_guid is null) or (dc_orderrec_guid = "")) and (trim(VisitType[1]) is in ("Inpatient","Observation"))) then
|
||
|
||
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "You cannot print the patient discharge instructions until Discharge Order Reconciliation is complete."
|
||
,"Discharge Order Reconciliation Incomplete","OK" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Question" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}},"Button1" as {{{SINGLE-QUOTE}}}MessageBoxDefaultButton{{{SINGLE-QUOTE}}};
|
||
resulttext := dialogResult as string;
|
||
|
||
/*--If they decide they want to allow the user to launch order reconciliation from this error message we can use the logic below to match what appears when the document is opened. This includes the prompt to launch order rec.
|
||
dialogResult := call {{{SINGLE-QUOTE}}}MessageBox{{{SINGLE-QUOTE}}}.Show with "Discharge Order Reconciliation is INCOMPLETE. You cannot print the patient’s Discharge Instructions until the Discharge Order Reconciliation is completed. Do you want to launch Order Reconciliation now?"
|
||
,"Discharge Order Reconciliation Incomplete","YesNo" as {{{SINGLE-QUOTE}}}MessageBoxButtons{{{SINGLE-QUOTE}}},"Question" as {{{SINGLE-QUOTE}}}MessageBoxIcon{{{SINGLE-QUOTE}}},"Button1" as {{{SINGLE-QUOTE}}}MessageBoxDefaultButton{{{SINGLE-QUOTE}}};
|
||
|
||
resulttext := dialogResult as string;
|
||
|
||
if resulttext = "Yes" then
|
||
(thisDocumentCommunication) := argument;
|
||
OpenMedRec := MLM {{{SINGLE-QUOTE}}}DOC_Call_Med_Rec{{{SINGLE-QUOTE}}};
|
||
thisDocumentCommunication := CALL OpenMedRec WITH thisDocumentCommunication;
|
||
endif;
|
||
*/
|
||
|
||
for x in 1 seqto(count(theObservation.ValueObj.ListItemsList.IsSelected)) do
|
||
if theObservation.ValueObj.ListItemsList[x].Value = "Print and Send With Patient" then
|
||
theObservation.ValueObj.ListItemsList[x].IsSelected := false;
|
||
endif;
|
||
enddo;
|
||
endif;
|
||
|
||
|
||
;;
|
||
priority: 50
|
||
;;
|
||
evoke:
|
||
;;
|
||
logic: conclude true;
|
||
;;
|
||
action: return thisDocumentCommunication;
|
||
;;
|
||
Urgency: 50;;
|
||
end:
|