CalMHSA 100 – Shared Care Plan Report

Report Description

This report compiles all the “Assessment and Plans” from the Psych Medical Note Template together, if the “Add to Shared Care Plan” has been checked off in the template.

Report Name

Menu Path

Client Based

Report RDL Name

CalMHSA 100 Shared Care Plan Report

CalMHSA 100 Shared Care Plan Report (My Office)

Y

RDLCALMHSA_100_MedCarePlan

Parameters

Data Type

Hidden

Comments

Select Client

Auto Populate

N

 

Select Staff

Multi Select

N

A multi select that allows users to specify the staff(s) that will be used to pull the report’s data.

Select Procedures

Multi Select

N

A multi select that allows users to specify the procedure code(s) that will be used to pull the report’s data.

FROM

Date

N

A date filter that allows users to specify the beginning of the date range used to pull the report’s data. This can be set as NULL.

THRU

Date

N

A date filter that allows users to specify the end of the date range used to pull the report’s data. This can be set as NULL.

Select Program

Multiple Select

N

A multiple select that allows users to specify which program association the report will use when pulling data from

ClinicalDataAccess GroupId

Integer

Y

Passed by system at report run time based on currently logged in Staff

ExecutedByStaffId

Integer

Y

Passed by system at report run time based on currently logged in Staff

DataSets

Form(s)

CDAG enforced

Comments

DataSet1

Service Note (Client)

Y

Dataset is the primary dataset for the report. Pulls from Documents, with joins to Clients, Staff, and CustomCalMHSAPsychNote, plus optional joins to Services, Programs, and ProcedureCodes.

Core joins:

  • INNER JOIN Clients (c) ON c.ClientId = doc.ClientId, non-soft-deleted
  • INNER JOIN Staff (st) ON st.StaffId = doc.AuthorId, non-soft-deleted
  • INNER JOIN CustomCalMHSAPsychNote (psyn) ON psyn.DocumentVersionId = doc.CurrentDocumentVersionId, non-soft-deleted
  • LEFT JOIN Services (s) ON doc.ServiceId = s.ServiceId, non-soft-deleted
  • LEFT JOIN Programs (p) ON s.ProgramId = p.ProgramId, non-soft-deleted
  • LEFT JOIN ProcedureCodes (pc) ON s.ProcedureCodeId = pc.ProcedureCodeId, non-soft-deleted
  • CROSS APPLY ssf_ApplyCDAGRules(@ClinicalDataAccessGroupId, p.ProgramId, c.ClientId, doc.DocumentId, @ExecutedByStaffId). Applies CDAG control

 

Pull data based on the following criteria:

  • doc.RecordDeleted = ‘N’
  • doc.Status IN (21, 22) (both Unsigned/Pending and Signed documents are included)
  • psyn.AddSharedPlan = ‘Y’ OR is NULL (excludes notes explicitly marked as not shared)
  • doc.EffectiveDate >= @FROM, only applied if @FROM is provided
  • doc.EffectiveDate <= @THRU + 1 day, only applied if @THRU is provided
  • pc.ProcedureCodeId must be in the selected @Procedures parameter list
  • doc.AuthorId must be in the selected @Staff parameter list
  • doc.ClientId must equal the selected @ClientId parameter
  • s.ProgramId must be in the selected @Programs parameter list

 

Special Notes regarding the query:

  • Client Name and Author are concatenated as LastName + ‘,’ + FirstName for display purposes
  • DOB is formatted as MM-dd-yyyy
  • Status is translated from its internal code to a display name via ssf_GetGlobalCodeNameById()
  • Licenses is built via a correlated subquery using STUFF(…FOR XML PATH(”)) to concatenate all of a staff member’s active license/degree names into a single comma-separated string
  • Within the Licenses subquery: only non-soft-deleted StaffLicenseDegrees records are included, where the license’s Start Date (or current date, if none) is on/before today and End Date (or current date, if none) is on/after today (i.e., only currently active licenses), and NPI and DEA license types are excluded from the concatenated list
  • Results are ordered by doc.EffectiveDate, descending (most recent first)

 

Procedures

Procedure/Rates (Admin) -> Procedure Code Details

N

Dataset is used to populate the Procedure Code parameter. Pulls data from the ProcedureCodes table.

Pull data based on the following criteria:

  • Only pull records where the Procedure Code is Active
  • Only pull records that are non-soft-deleted

 

Special Notes regarding the query:

  • Results are ordered by DisplayAs

Staff

Staff/Users (Admin) -> Staff Details

N

Dataset is used to populate the Staff Name parameter. Pulls data from the Staff table.

Pull data based on the following criteria:

  • Only pull records where the Staff record is Active
  • Only pull records that are non-soft-deleted
  • Exclude any Staff record whose First Name contains “System” (excludes system users)
  • Only pull records where NonStaffUser is not ‘Y’ (excludes non-staff users)
  • Exclude any Staff record whose Email contains “streamline”
  • Exclude any Staff record whose Email contains “buchanan”
  • Exclude any Staff record whose UserCode contains “Admin”

 

Special Notes regarding the query:

  • Staff Name is concatenated as LastName + ‘,’ + FirstName for display purposes
  • Results are ordered by LastName, then FirstName, then StaffId

 

Programs

Programs (Admin)

Y

Dataset is used to populate the Program parameter. Pulls data from the StaffClinicalDataAccessGroup table with LEFT OUTER JOINs to Programs and ClinicaldataAccessGroupPrograms table.

Pulls data base on the following criteria:

·       All records from all involve tables are non-softdeleted.

·       Only pull Programs records whose Active column value is within what is selected in the Active Program parameter.

·       Only pull StaffClinicalDataAccessGroup records whose ClinicalDataAccessGroupId matches with the value within ClinicalDataAccess GroupId parameter

·       Only pull StaffClinicalDataAccessGroup records whose StaffId matches with the values within the ExecutedByStaffId parameter

 

GetCountyLogo

N/A

N/A

County logo image for display on page header

 

 

 

Default User Roles

 

 

 

CalMHSA SysAdmin

County Affiliate SysAdmin

LPHA/Clinician

Medical Supervisor

Medication Rx

Non-LPHA

Pharmacist

Prescriber