Definition
Information
Section titled “Information”The Prescribing Issuerecord model records medication issues for patients, including item details, dosage, quantity, course duration and issue method. It also holds compliance values, estimated NHS cost, patient and pharmacy messages, review information, cancellation and printing flags, and repeat-dispensing parent issue information.
Soft-Deleted Records
Section titled “Soft-Deleted Records”_deleted indicates whether the record has been deleted in the source system.
Examples
Section titled “Examples”prescribing.issuerecord with carerecord.consultationsection, prescribing.drugrecord and prescribing.localmixture details
Section titled “prescribing.issuerecord with carerecord.consultationsection, prescribing.drugrecord and prescribing.localmixture details”Return records alongside descriptive values from the related tables.
SELECT m."issuerecordid", m."consultationsectionid", p1."originalheading" AS "consultationsection_originalheading", m."drugrecordid", p2."originalterm" AS "drugrecord_originalterm", m."localmixtureid", p3."localmixturename" AS "localmixturename"FROM prescribing.issuerecord AS mLEFT JOIN carerecord.consultationsection AS p1 ON p1."consultationsectionid" = m."consultationsectionid" AND p1."organisation" = m."organisation"LEFT JOIN prescribing.drugrecord AS p2 ON p2."drugrecordid" = m."drugrecordid" AND p2."organisation" = m."organisation"LEFT JOIN prescribing.localmixture AS p3 ON p3."localmixtureid" = m."localmixtureid" AND p3."organisation" = m."organisation";carerecord.problemissuerecord count per prescribing.issuerecord
Section titled “carerecord.problemissuerecord count per prescribing.issuerecord”Count related carerecord.problemissuerecord records for each prescribing.issuerecord record, joined on issuerecordid.
SELECT m."issuerecordid", m."originalterm", COUNT(c."issuerecordid") AS problemissuerecord_countFROM prescribing.issuerecord AS mLEFT JOIN carerecord.problemissuerecord AS c ON m."issuerecordid" = c."issuerecordid" AND m."organisation" = c."organisation"GROUP BY m."issuerecordid", m."originalterm"ORDER BY problemissuerecord_count DESC;Row count by carerecord.consultationsection originalheading
Section titled “Row count by carerecord.consultationsection originalheading”Count prescribing.issuerecord records for each carerecord.consultationsection value, joined on consultationsectionid.
SELECT p."originalheading" AS "consultationsection_originalheading", COUNT(*) AS row_countFROM prescribing.issuerecord AS mINNER JOIN carerecord.consultationsection AS p ON p."consultationsectionid" = m."consultationsectionid" AND p."organisation" = m."organisation"GROUP BY p."originalheading"ORDER BY row_count DESC;