Skip to content
Partner Developer Portal

Definition

The Prescribing Issuemethod model holds descriptions of medication issue methods. Each entry records an issue-method identifier, descriptive text and source organisation information.

_deleted indicates whether the record has been deleted in the source system.

prescribing.drugrecord count per prescribing.issuemethod

Section titled “prescribing.drugrecord count per prescribing.issuemethod”

Count related prescribing.drugrecord records for each prescribing.issuemethod record, joined on mostrecentissuemethod.

:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::

SELECT
m."issuemethodid",
m."description",
COUNT(c."mostrecentissuemethod") AS drugrecord_count
FROM prescribing.issuemethod AS m
LEFT JOIN prescribing.drugrecord AS c
ON m."issuemethodid" = c."mostrecentissuemethod"
AND m."organisation" = c."organisation"
GROUP BY m."issuemethodid", m."description"
ORDER BY drugrecord_count DESC;

prescribing.drugrecord records with prescribing.issuemethod details

Section titled “prescribing.drugrecord records with prescribing.issuemethod details”

List prescribing.drugrecord records with the prescribing.issuemethod values they reference through mostrecentissuemethod.

:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::

SELECT
c."drugrecordid",
c."authorisedcoursedate",
m."issuemethodid",
m."description" AS "issuemethod_description"
FROM prescribing.drugrecord AS c
INNER JOIN prescribing.issuemethod AS m
ON m."issuemethodid" = c."mostrecentissuemethod"
AND m."organisation" = c."organisation";

prescribing.issuerecord count per prescribing.issuemethod

Section titled “prescribing.issuerecord count per prescribing.issuemethod”

Count related prescribing.issuerecord records for each prescribing.issuemethod record, joined on issuemethod.

:::caution[Unverified join] This join is inferred from matching column names and is not part of the documented relationships. Check the results before relying on it. :::

SELECT
m."issuemethodid",
m."description",
COUNT(c."issuemethod") AS issuerecord_count
FROM prescribing.issuemethod AS m
LEFT JOIN prescribing.issuerecord AS c
ON m."issuemethodid" = c."issuemethod"
AND m."organisation" = c."organisation"
GROUP BY m."issuemethodid", m."description"
ORDER BY issuerecord_count DESC;