Definition
Information
Section titled “Information”The Carerecord Problemobservation model links patient problems with clinical observations and records a link-type value for the association. It holds problem-observation, observation and patient identifiers together with source organisation information, describing the observation association recorded against the patient’s problem.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”carerecord.problemobservation with carerecord.observation and dbo.patient details
Section titled “carerecord.problemobservation with carerecord.observation and dbo.patient details”Return records alongside descriptive values from the related tables.
SELECT m."problemobservationid", m."observationid", p1."associatedtext" AS "observation_associatedtext", m."patientid", p2."displayname" AS "patient_displayname"FROM carerecord.problemobservation AS mLEFT JOIN carerecord.observation AS p1 ON p1."observationid" = m."observationid" AND p1."organisation" = m."organisation"LEFT JOIN dbo.patient AS p2 ON p2."patientid" = m."patientid" AND p2."organisation" = m."organisation";carerecord.problemdiary count per carerecord.problemobservation
Section titled “carerecord.problemdiary count per carerecord.problemobservation”Count related carerecord.problemdiary records for each carerecord.problemobservation record, joined on problemobservationid.
SELECT m."problemobservationid", m."linktype", COUNT(c."problemobservationid") AS problemdiary_countFROM carerecord.problemobservation AS mLEFT JOIN carerecord.problemdiary AS c ON m."problemobservationid" = c."problemobservationid" AND m."organisation" = c."organisation"GROUP BY m."problemobservationid", m."linktype"ORDER BY problemdiary_count DESC;Row count by carerecord.observation associatedtext
Section titled “Row count by carerecord.observation associatedtext”Count carerecord.problemobservation records for each carerecord.observation value, joined on observationid.
SELECT p."associatedtext" AS "observation_associatedtext", COUNT(*) AS row_countFROM carerecord.problemobservation AS mINNER JOIN carerecord.observation AS p ON p."observationid" = m."observationid" AND p."organisation" = m."organisation"GROUP BY p."associatedtext"ORDER BY row_count DESC;